Support protocol-independent URLs (#1787)
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 18 Nov 2013 12:18:17 +0000 (13:18 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 18 Nov 2013 12:18:17 +0000 (13:18 +0100)
youtube_dl/extractor/youtube.py

index 514a11f7fd116f577179e7e58f13cf319515301e..9aa4c6fab6d05d08fa23a6ff5225dda7dbacc6c8 100644 (file)
@@ -141,7 +141,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
     IE_DESC = u'YouTube.com'
     _VALID_URL = r"""(?xi)^
                      (
-                         (?:https?://)?                                       # http(s):// (optional)
+                         (?:https?://|//)?                                    # http(s):// or protocol-independent URL (optional)
                          (?:(?:(?:(?:\w+\.)?youtube(?:-nocookie)?\.com/|
                             tube\.majestyc\.net/|
                             youtube\.googleapis\.com/)                        # the various hostnames, with wildcard subdomains
@@ -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": {