mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-08-22 07:10:37 +02:00
[bandcamp] Modernize
This commit is contained in:
parent
1e52776ac3
commit
ba717dca97
@ -10,6 +10,8 @@
|
||||
)
|
||||
from ..utils import (
|
||||
ExtractorError,
|
||||
float_or_none,
|
||||
int_or_none,
|
||||
)
|
||||
|
||||
|
||||
@ -56,7 +58,7 @@ def _real_extract(self, url):
|
||||
'ext': ext,
|
||||
'vcodec': 'none',
|
||||
'acodec': ext,
|
||||
'abr': int(abr_str),
|
||||
'abr': int_or_none(abr_str),
|
||||
})
|
||||
|
||||
self._sort_formats(formats)
|
||||
@ -65,7 +67,7 @@ def _real_extract(self, url):
|
||||
'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')
|
||||
|
Loading…
Reference in New Issue
Block a user