[reddit] add 'previews' option (#4322)
another way to disable this new behavior
This commit is contained in:
@@ -2716,6 +2716,17 @@ Description
|
||||
Ignore all submissions posted before/after the submission with this ID.
|
||||
|
||||
|
||||
extractor.reddit.previews
|
||||
-------------------------
|
||||
Type
|
||||
``bool``
|
||||
Default
|
||||
``true``
|
||||
Description
|
||||
For failed downloads from external URLs / child extractors,
|
||||
download Reddit's preview image/video if available.
|
||||
|
||||
|
||||
extractor.reddit.recursion
|
||||
--------------------------
|
||||
Type
|
||||
|
||||
@@ -30,6 +30,7 @@ class RedditExtractor(Extractor):
|
||||
|
||||
parentdir = self.config("parent-directory")
|
||||
max_depth = self.config("recursion", 0)
|
||||
previews = self.config("previews", True)
|
||||
|
||||
videos = self.config("videos", True)
|
||||
if videos:
|
||||
@@ -119,7 +120,7 @@ class RedditExtractor(Extractor):
|
||||
if match:
|
||||
extra.append(match.group(1))
|
||||
elif not match_user(url) and not match_subreddit(url):
|
||||
if "preview" in data:
|
||||
if previews and "preview" in data:
|
||||
data["_fallback"] = self._previews(data)
|
||||
yield Message.Queue, text.unescape(url), data
|
||||
if "_fallback" in data:
|
||||
|
||||
Reference in New Issue
Block a user