mirror of
https://github.com/blackjack4494/yt-dlc.git
synced 2024-12-22 15:57:23 +00:00
[abc] add support for audio extraction
This commit is contained in:
parent
36d7281037
commit
7687b354c5
1 changed files with 12 additions and 1 deletions
|
@ -36,6 +36,15 @@ class ABCIE(InfoExtractor):
|
||||||
'title': 'Marriage Equality: Warren Entsch introduces same sex marriage bill',
|
'title': 'Marriage Equality: Warren Entsch introduces same sex marriage bill',
|
||||||
},
|
},
|
||||||
'add_ie': ['Youtube'],
|
'add_ie': ['Youtube'],
|
||||||
|
}, {
|
||||||
|
'url': 'http://www.abc.net.au/news/2015-10-23/nab-lifts-interest-rates-following-westpac-and-cba/6880080',
|
||||||
|
'md5': 'b96eee7c9edf4fc5a358a0252881cc1f',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '6880080',
|
||||||
|
'ext': 'mp3',
|
||||||
|
'title': 'NAB lifts interest rates, following Westpac and CBA',
|
||||||
|
'description': 'md5:f13d8edc81e462fce4a0437c7dc04728',
|
||||||
|
},
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
@ -43,7 +52,7 @@ class ABCIE(InfoExtractor):
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
mobj = re.search(
|
mobj = re.search(
|
||||||
r'inline(?P<type>Video|YouTube)Data\.push\((?P<json_data>[^)]+)\);',
|
r'inline(?P<type>Video|Audio|YouTube)Data\.push\((?P<json_data>[^)]+)\);',
|
||||||
webpage)
|
webpage)
|
||||||
if mobj is None:
|
if mobj is None:
|
||||||
raise ExtractorError('Unable to extract video urls')
|
raise ExtractorError('Unable to extract video urls')
|
||||||
|
@ -60,11 +69,13 @@ class ABCIE(InfoExtractor):
|
||||||
|
|
||||||
formats = [{
|
formats = [{
|
||||||
'url': url_info['url'],
|
'url': url_info['url'],
|
||||||
|
'vcodec': url_info.get('codec') if mobj.group('type') == 'Video' else 'none',
|
||||||
'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]
|
||||||
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue