From 7e8a747c5633aa1377c2c5b8fc1f54584ad1318d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 18 Jun 2020 15:04:15 +0200 Subject: [PATCH] improve output of '-K' for parent extractors 2 (#825) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is what bb882b8 was supposed to be, but I managed to not include those changes in the first commit … --- gallery_dl/job.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gallery_dl/job.py b/gallery_dl/job.py index 130df58f..5891715d 100644 --- a/gallery_dl/job.py +++ b/gallery_dl/job.py @@ -454,15 +454,18 @@ class KeywordJob(Job): self.print_kwdict(kwdict) def handle_queue(self, url, kwdict): + extr = None + if "_extractor" in kwdict: + extr = kwdict["_extractor"].from_url(url) + if not util.filter_dict(kwdict): self.extractor.log.info( "This extractor only spawns other extractors " "and does not provide any metadata on its own.") - if "_extractor" in kwdict: + if extr: self.extractor.log.info( "Showing results for '%s' instead:\n", url) - extr = kwdict["_extractor"].from_url(url) KeywordJob(extr, self).run() else: self.extractor.log.info( @@ -471,9 +474,9 @@ class KeywordJob(Job): print("Keywords for --chapter-filter:") print("------------------------------") self.print_kwdict(kwdict) - if self.extractor.categorytransfer: + if extr or self.extractor.categorytransfer: print() - KeywordJob(url, self).run() + KeywordJob(extr or url, self).run() raise exception.StopExtraction() @staticmethod