Merge remote-tracking branch 'dz0ny/patch-1'
[youtube-dl] / youtube_dl / extractor / youtube.py
index 514a11f7fd116f577179e7e58f13cf319515301e..41838237c617f9758054cef6499ef97b17df5e93 100644 (file)
@@ -139,10 +139,10 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
 
 class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
     IE_DESC = u'YouTube.com'
-    _VALID_URL = r"""(?xi)^
+    _VALID_URL = r"""(?x)^
                      (
-                         (?:https?://)?                                       # http(s):// (optional)
-                         (?:(?:(?:(?:\w+\.)?youtube(?:-nocookie)?\.com/|
+                         (?:https?://|//)?                                    # http(s):// or protocol-independent URL (optional)
+                         (?:(?:(?:(?:\w+\.)?[yY][oO][uU][tT][uU][bB][eE](?:-nocookie)?\.com/|
                             tube\.majestyc\.net/|
                             youtube\.googleapis\.com/)                        # the various hostnames, with wildcard subdomains
                          (?:.*?\#/)?                                          # handle anchor (#/) redirect urls
@@ -364,7 +364,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
             }
         },
         {
-            u"url":  u"https://www.YouTube.com/watch?v=yZIXLfi8CZQ",
+            u"url":  u"//www.YouTube.com/watch?v=yZIXLfi8CZQ",
             u"file":  u"yZIXLfi8CZQ.mp4",
             u"note": u"Embed-only video (#1746)",
             u"info_dict": {