]> jfr.im git - yt-dlp.git/commitdiff
[youtube] Add `shorts` to `_VALID_URL`
authorpukkandan <redacted>
Sun, 22 Aug 2021 15:04:59 +0000 (20:34 +0530)
committerpukkandan <redacted>
Sun, 22 Aug 2021 19:20:42 +0000 (00:50 +0530)
Normally the generic extractor will redirect the URL,
but the cookies consent screen may sometimes appear instead

Closes #752

yt_dlp/extractor/youtube.py

index bf007273cb29b7e6a974aed4376ad9de504edf05..5bce53349d997652431579c657ecc7350de79aa1 100644 (file)
@@ -945,7 +945,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                             youtube\.googleapis\.com)/                        # the various hostnames, with wildcard subdomains
                          (?:.*?\#/)?                                          # handle anchor (#/) redirect urls
                          (?:                                                  # the various things that can precede the ID:
-                             (?:(?:v|embed|e)/(?!videoseries))                # v/ or embed/ or e/
+                             (?:(?:v|embed|e|shorts)/(?!videoseries))         # v/ or embed/ or e/ or shorts/
                              |(?:                                             # or the v= param in all its forms
                                  (?:(?:watch|movie)(?:_popup)?(?:\.php)?/?)?  # preceding watch(_popup|.php) or nothing (like /?v=xxxx)
                                  (?:\?|\#!?)                                  # the params delimiter ? or # or #!
@@ -1831,7 +1831,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             'params': {
                 'extractor_args': {'youtube': {'player_skip': ['configs']}},
             },
-        }
+        }, {
+            # shorts
+            'url': 'https://www.youtube.com/shorts/BGQWPY4IigY',
+            'only_matching': True,
+        },
     ]
 
     @classmethod