aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-08-30 01:11:56 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-08-30 01:11:56 +0800
commitc0a656876cf3831deab90d0937e7cd81e95f6184 (patch)
treebeebcb99fff6e37e9c54cca9b21da84382561722 /youtube_dl/extractor
parent17a647630b504c730d77e71faf248628e45529c5 (diff)
[abc] Use int_or_none
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/abc.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/youtube_dl/extractor/abc.py b/youtube_dl/extractor/abc.py
index 06acf50d8..f9a389f67 100644
--- a/youtube_dl/extractor/abc.py
+++ b/youtube_dl/extractor/abc.py
@@ -6,6 +6,7 @@ from .common import InfoExtractor
from ..utils import (
ExtractorError,
js_to_json,
+ int_or_none,
)
@@ -59,10 +60,10 @@ class ABCIE(InfoExtractor):
formats = [{
'url': url_info['url'],
- 'width': int(url_info['width']),
- 'height': int(url_info['height']),
- 'tbr': int(url_info['bitrate']),
- 'filesize': int(url_info['filesize']),
+ 'width': int_or_none(url_info.get('width')),
+ 'height': int_or_none(url_info.get('height')),
+ 'tbr': int_or_none(url_info.get('bitrate')),
+ 'filesize': int_or_none(url_info.get('filesize')),
} for url_info in urls_info]
self._sort_formats(formats)