From 231dd4c80084fe35a06e3c2683d30a8016f48809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 14 Sep 2020 21:39:17 +0200 Subject: [PATCH] accumulate postprocessor objects (#994) Instead of one 'postprocessors' setting overwriting all others lower in the hierarchy, all postprocessors along the config path will now get collected into one big list. For example '--mtime-from-date' will therefore no longer cause other postprocessor settings in a config file to get ignored. --- gallery_dl/extractor/common.py | 4 ++++ gallery_dl/job.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 5e8770050e..cfdac3ed47 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -72,6 +72,10 @@ def config(self, key, default=None): return config.interpolate( ("extractor", self.category, self.subcategory), key, default) + def config_accumulate(self, key): + return config.accumulate( + ("extractor", self.category, self.subcategory), key) + def request(self, url, *, method="GET", session=None, retries=None, encoding=None, fatal=True, notfound=None, **kwargs): tries = 1 diff --git a/gallery_dl/job.py b/gallery_dl/job.py index 8d1849caa3..7d08b86d55 100644 --- a/gallery_dl/job.py +++ b/gallery_dl/job.py @@ -417,7 +417,7 @@ def initialize(self, kwdict=None): else: self.extractor.log.debug("Using download archive '%s'", path) - postprocessors = config("postprocessors") + postprocessors = self.extractor.config_accumulate("postprocessors") if postprocessors: pp_log = self.get_logger("postprocessor") pp_list = []