[vimeo] always convert width, height and bitrate to int
authorremitamine <remitamine@gmail.com>
Sat, 10 Oct 2015 20:05:29 +0000 (21:05 +0100)
committerremitamine <remitamine@gmail.com>
Sat, 10 Oct 2015 20:05:29 +0000 (21:05 +0100)
youtube_dl/extractor/vimeo.py

index 2051ac9de58cea3ec38e9fece0ff5ef629aa506f..97590d220db41e02cab6be7755cebc548ace70d2 100644 (file)
@@ -395,14 +395,14 @@ class VimeoIE(VimeoBaseInfoExtractor):
                     'ext': codec_extension,
                     'url': video_url,
                     'format_id': format_id,
-                    'width': file_info.get('width'),
-                    'height': file_info.get('height'),
-                    'tbr': file_info.get('bitrate'),
+                    'width': int_or_none(file_info.get('width')),
+                    'height': int_or_none(file_info.get('height')),
+                    'tbr': int_or_none(file_info.get('bitrate')),
                 })
         formats = []
-        hls = config_files.get("hls")
-        if hls:
-            formats = self._extract_m3u8_formats(hls['all'], video_id, 'mp4', 'm3u8_native', 0, 'hls', fatal=False)
+        m3u8_url = config_files.get('hls', {}).get('all')
+        if m3u8_url:
+            formats = self._extract_m3u8_formats(m3u8_url, video_id, 'mp4', 'm3u8_native', 0, 'hls', fatal=False)
         for key in ('other', 'sd', 'hd'):
             formats += files[key]
         self._sort_formats(formats)