diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-10-17 00:51:35 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-10-17 00:51:35 +0600 |
commit | ba717dca97925a21870fedcb46358d06cd5485ec (patch) | |
tree | 4e9e0b51c9c3ab7bcb544af7325ef3b190d63475 | |
parent | 1e52776ac3ebbafc2ec4697f3bc6ba05b7e5a9f8 (diff) |
[bandcamp] Modernize
-rw-r--r-- | youtube_dl/extractor/bandcamp.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/bandcamp.py b/youtube_dl/extractor/bandcamp.py index f19e19001..c1ef8051d 100644 --- a/youtube_dl/extractor/bandcamp.py +++ b/youtube_dl/extractor/bandcamp.py @@ -10,6 +10,8 @@ from ..compat import ( ) from ..utils import ( ExtractorError, + float_or_none, + int_or_none, ) @@ -56,7 +58,7 @@ class BandcampIE(InfoExtractor): 'ext': ext, 'vcodec': 'none', 'acodec': ext, - 'abr': int(abr_str), + 'abr': int_or_none(abr_str), }) self._sort_formats(formats) @@ -65,7 +67,7 @@ class BandcampIE(InfoExtractor): 'id': compat_str(data['id']), 'title': data['title'], 'formats': formats, - 'duration': float(data['duration']), + 'duration': float_or_none(data.get('duration')), } else: raise ExtractorError('No free songs found') |