]> jfr.im git - yt-dlp.git/commitdiff
[reddit] Add embedded url (#1090)
authoru-spec-png <redacted>
Sun, 26 Sep 2021 13:28:22 +0000 (13:28 +0000)
committerGitHub <redacted>
Sun, 26 Sep 2021 13:28:22 +0000 (18:58 +0530)
Authored by: u-spec-png

yt_dlp/extractor/reddit.py

index 8e1463d5be9bbe3029f089157f4c66514a7d350a..14592bc62cdae6410b5c9e84c98977fca059a3b0 100644 (file)
@@ -49,7 +49,7 @@ def _real_extract(self, url):
 
 
 class RedditRIE(InfoExtractor):
-    _VALID_URL = r'https?://(?:[^/]+\.)?reddit\.com/r/(?P<slug>[^/]+/comments/(?P<id>[^/?#&]+))'
+    _VALID_URL = r'https?://(?:[^/]+\.)?reddit(?:media)?\.com/r/(?P<slug>[^/]+/comments/(?P<id>[^/?#&]+))'
     _TESTS = [{
         'url': 'https://www.reddit.com/r/videos/comments/6rrwyj/that_small_heart_attack/',
         'info_dict': {
@@ -94,6 +94,9 @@ class RedditRIE(InfoExtractor):
         # reddit video @ nm reddit
         'url': 'https://nm.reddit.com/r/Cricket/comments/8idvby/lousy_cameraman_finds_himself_in_cairns_line_of/',
         'only_matching': True,
+    }, {
+        'url': 'https://www.redditmedia.com/r/serbia/comments/pu9wbx/ako_vu%C4%8Di%C4%87_izgubi_izbore_ja_%C4%87u_da_crknem/',
+        'only_matching': True,
     }]
 
     def _real_extract(self, url):