X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/d9d7cd0e85dc712461d9185db9df9d6c900a573b..00368b4c3a5d4e909e1b7ecfc4030bf28da020f3:/youtube_dl/extractor/sohu.py diff --git a/youtube_dl/extractor/sohu.py b/youtube_dl/extractor/sohu.py index 7da12ce..a62ed84 100644 --- a/youtube_dl/extractor/sohu.py +++ b/youtube_dl/extractor/sohu.py @@ -8,7 +8,11 @@ from ..compat import ( compat_str, compat_urllib_parse_urlencode, ) -from ..utils import ExtractorError +from ..utils import ( + ExtractorError, + int_or_none, + try_get, +) class SohuIE(InfoExtractor): @@ -169,10 +173,11 @@ class SohuIE(InfoExtractor): formats.append({ 'url': video_url, 'format_id': format_id, - 'filesize': data['clipsBytes'][i], - 'width': data['width'], - 'height': data['height'], - 'fps': data['fps'], + 'filesize': int_or_none( + try_get(data, lambda x: x['clipsBytes'][i])), + 'width': int_or_none(data.get('width')), + 'height': int_or_none(data.get('height')), + 'fps': int_or_none(data.get('fps')), }) self._sort_formats(formats)