Support protocol-independent URLs (#1787)

This commit is contained in:
Philipp Hagemeister 2013-11-18 13:18:17 +01:00
parent 96b31b6533
commit 83aa529330

View file

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