From 40e4cc62c4c5be357bfc87e3dc39fb1d1b36d9e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 6 Feb 2026 18:47:11 +0100 Subject: [PATCH] [common] pass job status to 'finalize()' --- gallery_dl/extractor/common.py | 2 +- gallery_dl/extractor/exhentai.py | 4 ++-- gallery_dl/extractor/instagram.py | 4 ++-- gallery_dl/extractor/patreon.py | 4 ++-- gallery_dl/extractor/twitter.py | 4 ++-- gallery_dl/extractor/vk.py | 4 ++-- gallery_dl/job.py | 6 +++--- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 89a56875..90aceed3 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -103,7 +103,7 @@ class Extractor(): self._init() self.initialize = util.noop - def finalize(self): + def finalize(self, status): pass def items(self): diff --git a/gallery_dl/extractor/exhentai.py b/gallery_dl/extractor/exhentai.py index a84dee0f..eba82a85 100644 --- a/gallery_dl/extractor/exhentai.py +++ b/gallery_dl/extractor/exhentai.py @@ -150,8 +150,8 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor): self.fallback_retries = self.config("fallback-retries", 2) self.original = self.config("original", True) - def finalize(self): - if not self.data: + def finalize(self, status): + if not status or not self.data: return if self.mpv: diff --git a/gallery_dl/extractor/instagram.py b/gallery_dl/extractor/instagram.py index 18f57c9f..4b34c844 100644 --- a/gallery_dl/extractor/instagram.py +++ b/gallery_dl/extractor/instagram.py @@ -122,8 +122,8 @@ class InstagramExtractor(Extractor): def posts(self): return () - def finalize(self): - if self._cursor: + def finalize(self, status): + if status and self._cursor: self.log.info("Use '-o cursor=%s' to continue downloading " "from the current position", self._cursor) diff --git a/gallery_dl/extractor/patreon.py b/gallery_dl/extractor/patreon.py index 2a1282e4..2635c4b3 100644 --- a/gallery_dl/extractor/patreon.py +++ b/gallery_dl/extractor/patreon.py @@ -74,8 +74,8 @@ class PatreonExtractor(Extractor): else: self.log.debug("skipping %s (%s %s)", url, fhash, kind) - def finalize(self): - if self._cursor: + def finalize(self, status): + if status and self._cursor: self.log.info("Use '-o cursor=%s' to continue downloading " "from the current position", self._cursor) diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index 69fa44e9..f0f293b8 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -672,8 +672,8 @@ class TwitterExtractor(Extractor): def tweets(self): """Yield all relevant tweet objects""" - def finalize(self): - if self._cursor: + def finalize(self, status): + if status and self._cursor: self.log.info("Use '-o cursor=%s' to continue downloading " "from the current position", self._cursor) diff --git a/gallery_dl/extractor/vk.py b/gallery_dl/extractor/vk.py index ea422651..a9774e1c 100644 --- a/gallery_dl/extractor/vk.py +++ b/gallery_dl/extractor/vk.py @@ -26,8 +26,8 @@ class VkExtractor(Extractor): def _init(self): self.offset = text.parse_int(self.config("offset")) - def finalize(self): - if self.offset: + def finalize(self, status): + if status and self.offset: self.log.info("Use '-o offset=%s' to continue downloading " "from the current position", self.offset) diff --git a/gallery_dl/job.py b/gallery_dl/job.py index e79e30a1..710ffd95 100644 --- a/gallery_dl/job.py +++ b/gallery_dl/job.py @@ -198,11 +198,11 @@ class Job(): if msg is None: log.info("No results for %s", extractor.url) finally: + if extractor.status: + self.status |= extractor.status self.handle_finalize() - extractor.finalize() + extractor.finalize(self.status) - if s := extractor.status: - self.status |= s return self.status def dispatch(self, messages):