[vimeo] Support protocol-relative URLs
authorPhilipp Hagemeister <phihag@phihag.de>
Wed, 8 Jan 2014 21:42:52 +0000 (22:42 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Wed, 8 Jan 2014 21:42:52 +0000 (22:42 +0100)
youtube_dl/extractor/generic.py
youtube_dl/extractor/vimeo.py

index ff23161d787b9ef7f1fad04301e375f7a6e41fc6..a9023f38d3b1ecd04aff4032fa6ceade7e7575b5 100644 (file)
@@ -230,7 +230,7 @@ class GenericIE(InfoExtractor):
 
         # Look for embedded (iframe) Vimeo player
         mobj = re.search(
-            r'<iframe[^>]+?src="(https?://player.vimeo.com/video/.+?)"', webpage)
+            r'<iframe[^>]+?src="((?:https?:)?//player.vimeo.com/video/.+?)"', webpage)
         if mobj:
             player_url = unescapeHTML(mobj.group(1))
             surl = smuggle_url(player_url, {'Referer': url})
index 540ca4fcc908b209e7972e10908f243e943163c9..1936755499ceca890c7b4513298a64444293b71d 100644 (file)
@@ -24,7 +24,7 @@ class VimeoIE(InfoExtractor):
 
     # _VALID_URL matches Vimeo URLs
     _VALID_URL = r'''(?x)
-        (?P<proto>https?://)?
+        (?P<proto>(?:https?:)?//)?
         (?:(?:www|(?P<player>player))\.)?
         vimeo(?P<pro>pro)?\.com/
         (?:.*?/)?
@@ -149,9 +149,6 @@ class VimeoIE(InfoExtractor):
 
         # Extract ID from URL
         mobj = re.match(self._VALID_URL, url)
-        if mobj is None:
-            raise ExtractorError('Invalid URL: %s' % url)
-
         video_id = mobj.group('id')
         if mobj.group('pro') or mobj.group('player'):
             url = 'http://player.vimeo.com/video/' + video_id