[youtube] Modify the regex to match ids of length 11 (fixes #1396)
[youtube-dl] / youtube_dl / extractor / youtube.py
index bad15cb44a68d9ec1914304241fb7c1c2106bfc5..6a835129310327942ceffd7967dd880ff425f661 100644 (file)
@@ -150,7 +150,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                          |youtu\.be/                                          # just youtu.be/xxxx
                          )
                      )?                                                       # all until now is optional -> you can pass the naked ID
-                     ([0-9A-Za-z_-]+)                                         # here is it! the YouTube video ID
+                     ([0-9A-Za-z_-]{11})                                      # here is it! the YouTube video ID
                      (?(1).+)?                                                # if we found the ID, everything can follow
                      $"""
     _NEXT_URL_RE = r'[\?&]next_url=([^&]+)'