[youtube] Restrict embed regex (#14600)
authorSergey M․ <dstftw@gmail.com>
Fri, 27 Oct 2017 15:26:43 +0000 (22:26 +0700)
committerSergey M․ <dstftw@gmail.com>
Fri, 27 Oct 2017 15:26:43 +0000 (22:26 +0700)
youtube_dl/extractor/youtube.py

index 5aef555fb9f093bbc27faacd508f8042d706b20e..9943dddc13b478ce23e71c43d19f5cf18694f90b 100644 (file)
@@ -1391,7 +1391,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             )
             (["\'])
                 (?P<url>(?:https?:)?//(?:www\.)?youtube(?:-nocookie)?\.com/
-                (?:embed|v|p)/.+?)
+                (?:embed|v|p)/[0-9A-Za-z_-]{11}.*?)
             \1''', webpage)]
 
         # lazyYT YouTube embed