[reddit] add 'embeds' option (#6357)

This commit is contained in:
Mike Fährmann
2024-10-22 17:03:11 +02:00
parent 33161da121
commit b08da4ffc7
3 changed files with 20 additions and 2 deletions

View File

@@ -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(