[reddit] use 'dash_url' for videos (#3258) (#3306)

* 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 <steven@docherty.ca>
Co-authored-by: Mike Fährmann <mike_faehrmann@web.de>
pull/3329/head
Steven Docherty 2 years ago committed by GitHub
parent 0e75358af8
commit a7c7953107
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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"]:

Loading…
Cancel
Save