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.
This commit is contained in:
Mike Fährmann
2020-09-14 21:39:17 +02:00
parent 392d022b04
commit 231dd4c800
2 changed files with 5 additions and 1 deletions

View File

@@ -72,6 +72,10 @@ class Extractor():
return config.interpolate( return config.interpolate(
("extractor", self.category, self.subcategory), key, default) ("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, def request(self, url, *, method="GET", session=None, retries=None,
encoding=None, fatal=True, notfound=None, **kwargs): encoding=None, fatal=True, notfound=None, **kwargs):
tries = 1 tries = 1

View File

@@ -417,7 +417,7 @@ class DownloadJob(Job):
else: else:
self.extractor.log.debug("Using download archive '%s'", path) self.extractor.log.debug("Using download archive '%s'", path)
postprocessors = config("postprocessors") postprocessors = self.extractor.config_accumulate("postprocessors")
if postprocessors: if postprocessors:
pp_log = self.get_logger("postprocessor") pp_log = self.get_logger("postprocessor")
pp_list = [] pp_list = []