Skip to content

Commit

Permalink
accumulate postprocessor objects (#994)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mikf committed Sep 14, 2020
1 parent 392d022 commit 231dd4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions gallery_dl/extractor/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gallery_dl/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit 231dd4c

Please sign in to comment.