]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[tvigle] Modernize
authorSergey M․ <dstftw@gmail.com>
Sat, 30 May 2015 21:01:41 +0000 (03:01 +0600)
committerSergey M․ <dstftw@gmail.com>
Sat, 30 May 2015 21:01:41 +0000 (03:01 +0600)
youtube_dl/extractor/tvigle.py

index 4e95bd30f92c0c387053bbbce20df7f311043cfe..a856938885e1000e8da318ab7383ab50a911be52 100644 (file)
@@ -64,8 +64,8 @@ class TvigleIE(InfoExtractor):
         item = video_data['playlist']['items'][0]
 
         title = item['title']
-        description = item['description']
-        thumbnail = item['thumbnail']
+        description = item.get('description')
+        thumbnail = item.get('thumbnail')
         duration = float_or_none(item.get('durationMilliseconds'), 1000)
         age_limit = parse_age_limit(item.get('ageRestrictions'))
 
@@ -83,7 +83,7 @@ class TvigleIE(InfoExtractor):
                     'format_id': '%s-%s' % (vcodec, format_id),
                     'vcodec': vcodec,
                     'height': int_or_none(height),
-                    'filesize': item['video_files_size'][vcodec][format_id],
+                    'filesize': int_or_none(item.get('video_files_size', {}).get(vcodec, {}).get(format_id)),
                 })
         self._sort_formats(formats)