mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-13 03:27:15 +08:00
[abc] simplify and add a test
This commit is contained in:
parent
a79ddbf62b
commit
dded391650
@ -45,6 +45,9 @@ class ABCIE(InfoExtractor):
|
|||||||
'title': 'NAB lifts interest rates, following Westpac and CBA',
|
'title': 'NAB lifts interest rates, following Westpac and CBA',
|
||||||
'description': 'md5:f13d8edc81e462fce4a0437c7dc04728',
|
'description': 'md5:f13d8edc81e462fce4a0437c7dc04728',
|
||||||
},
|
},
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.abc.net.au/news/2015-10-19/6866214',
|
||||||
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
@ -67,22 +70,15 @@ class ABCIE(InfoExtractor):
|
|||||||
return self.playlist_result([
|
return self.playlist_result([
|
||||||
self.url_result(url_info['url']) for url_info in urls_info])
|
self.url_result(url_info['url']) for url_info in urls_info])
|
||||||
|
|
||||||
if mobj.group('type') == 'Video':
|
formats = [{
|
||||||
formats = [{
|
'url': url_info['url'],
|
||||||
'url': url_info['url'],
|
'vcodec': url_info.get('codec') if mobj.group('type') == 'Video' else 'none',
|
||||||
'vcodec': url_info.get('codec'),
|
'width': int_or_none(url_info.get('width')),
|
||||||
'width': int_or_none(url_info.get('width')),
|
'height': int_or_none(url_info.get('height')),
|
||||||
'height': int_or_none(url_info.get('height')),
|
'tbr': int_or_none(url_info.get('bitrate')),
|
||||||
'tbr': int_or_none(url_info.get('bitrate')),
|
'filesize': int_or_none(url_info.get('filesize')),
|
||||||
'filesize': int_or_none(url_info.get('filesize')),
|
} for url_info in urls_info]
|
||||||
} for url_info in urls_info]
|
|
||||||
else:
|
|
||||||
formats = [{
|
|
||||||
'url': url_info['url'],
|
|
||||||
'vcodec': 'none',
|
|
||||||
'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)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user