mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
[reddit] add 'embeds' option (#6357)
This commit is contained in:
parent
33161da121
commit
b08da4ffc7
@ -3702,6 +3702,16 @@ Description
|
||||
Note: This requires 1 additional API call for every 100 extra comments.
|
||||
|
||||
|
||||
extractor.reddit.embeds
|
||||
-----------------------
|
||||
Type
|
||||
``bool``
|
||||
Default
|
||||
``true``
|
||||
Description
|
||||
Download embedded comments media.
|
||||
|
||||
|
||||
extractor.reddit.date-min & .date-max
|
||||
-------------------------------------
|
||||
Type
|
||||
|
@ -31,6 +31,7 @@ class RedditExtractor(Extractor):
|
||||
parentdir = self.config("parent-directory")
|
||||
max_depth = self.config("recursion", 0)
|
||||
previews = self.config("previews", True)
|
||||
embeds = self.config("embeds", True)
|
||||
|
||||
videos = self.config("videos", True)
|
||||
if videos:
|
||||
@ -100,7 +101,7 @@ class RedditExtractor(Extractor):
|
||||
for comment in comments:
|
||||
html = comment["body_html"] or ""
|
||||
href = (' href="' in html)
|
||||
media = ("media_metadata" in comment)
|
||||
media = (embeds and "media_metadata" in comment)
|
||||
|
||||
if media or href:
|
||||
comment["date"] = text.parse_timestamp(
|
||||
|
@ -171,7 +171,6 @@ __tests__ = (
|
||||
{
|
||||
"#url" : "https://www.reddit.com/r/RobloxArt/comments/15ko0qu/",
|
||||
"#comment" : "comment embeds (#5366)",
|
||||
"#category": ("", "reddit", "submission"),
|
||||
"#class" : reddit.RedditSubmissionExtractor,
|
||||
"#options" : {"comments": 10},
|
||||
"#urls" : (
|
||||
@ -180,6 +179,14 @@ __tests__ = (
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.reddit.com/r/RobloxArt/comments/15ko0qu/",
|
||||
"#comment" : "disabled comment embeds (#6357)",
|
||||
"#class" : reddit.RedditSubmissionExtractor,
|
||||
"#options" : {"comments": 10, "embeds": False},
|
||||
"#urls" : "https://i.redd.it/ppt5yciyipgb1.jpg",
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.reddit.com/user/TheSpiritTree/comments/srilyf/",
|
||||
"#comment" : "user page submission (#2301)",
|
||||
|
Loading…
Reference in New Issue
Block a user