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:
@@ -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
|
||||||
|
|||||||
@@ -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 = []
|
||||||
|
|||||||
Reference in New Issue
Block a user