Skip to content

Commit

Permalink
improve 'include' handling (#4982)
Browse files Browse the repository at this point in the history
- remove spaces when given as string
- warn about invalid vales
  • Loading branch information
mikf committed Dec 28, 2023
1 parent f954419 commit f36dafa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gallery_dl/extractor/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,15 @@ def _dispatch_extractors(self, extractor_data, default=()):
if include == "all":
include = extractors
elif isinstance(include, str):
include = include.split(",")
include = include.replace(" ", "").split(",")

result = [(Message.Version, 1)]
for category in include:
if category in extractors:
try:
extr, url = extractors[category]
except KeyError:
self.log.warning("Invalid include '%s'", category)
else:
result.append((Message.Queue, url, {"_extractor": extr}))
return iter(result)

Expand Down

0 comments on commit f36dafa

Please sign in to comment.