From a7c79531078e3c34f4d8ae8f70a8cd52cc3b504f Mon Sep 17 00:00:00 2001 From: Steven Docherty Date: Sun, 27 Nov 2022 08:09:55 -0500 Subject: [PATCH] [reddit] use 'dash_url' for videos (#3258) (#3306) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * use fallback_url for reddit_video to fix issue 3258 * changed to dash_url to include audio * update - use [] instead of .get - catch TypeErrors in case one of the elements is not a dict Co-authored-by: InterruptSpeed Co-authored-by: Mike Fährmann --- gallery_dl/extractor/reddit.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gallery_dl/extractor/reddit.py b/gallery_dl/extractor/reddit.py index 954a84f5..0ec8478b 100644 --- a/gallery_dl/extractor/reddit.py +++ b/gallery_dl/extractor/reddit.py @@ -69,6 +69,11 @@ class RedditExtractor(Extractor): submission["_ytdl_extra"] = { "title": submission["title"], } + try: + url = (submission["secure_media"] + ["reddit_video"]["dash_url"]) + except (KeyError, TypeError): + pass yield Message.Url, "ytdl:" + url, submission elif not submission["is_self"]: