[googlesearch] Move test to extractor
[youtube-dl] / youtube_dl / extractor / vimeo.py
index 10844f39e68180eba148a09f87b588df8c2b8a03..55f6cd0d8e1d9e7de2fd49f0e123b23e47496f13 100644 (file)
@@ -151,6 +151,19 @@ class VimeoIE(VimeoBaseInfoExtractor, SubtitlesInfoExtractor):
                 'duration': 62,
             }
         },
+        {
+            'note': 'video player needs Referer',
+            'url': 'http://vimeo.com/user22258446/review/91613211/13f927e053',
+            'md5': '6295fdab8f4bf6a002d058b2c6dce276',
+            'info_dict': {
+                'id': '91613211',
+                'ext': 'mp4',
+                'title': 'Death by dogma versus assembling agile - Sander Hoogendoorn',
+                'uploader': 'DevWeek Events',
+                'duration': 2773,
+                'thumbnail': 're:^https?://.*\.jpg$',
+            }
+        }
     ]
 
     @classmethod
@@ -205,6 +218,8 @@ class VimeoIE(VimeoBaseInfoExtractor, SubtitlesInfoExtractor):
         if data is not None:
             headers = headers.copy()
             headers.update(data)
+        if 'Referer' not in headers:
+            headers['Referer'] = url
 
         # Extract ID from URL
         mobj = re.match(self._VALID_URL, url)
@@ -276,7 +291,7 @@ class VimeoIE(VimeoBaseInfoExtractor, SubtitlesInfoExtractor):
         if video_thumbnail is None:
             video_thumbs = config["video"].get("thumbs")
             if video_thumbs and isinstance(video_thumbs, dict):
-                _, video_thumbnail = sorted((int(width), t_url) for (width, t_url) in video_thumbs.items())[-1]
+                _, video_thumbnail = sorted((int(width if width.isdigit() else 0), t_url) for (width, t_url) in video_thumbs.items())[-1]
 
         # Extract video description
         video_description = None