1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-14 05:17:25 +00:00

[youtube] extract width and height from fmt_list

This commit is contained in:
remitamine 2016-03-02 14:23:17 +01:00
parent 6114090418
commit 82156fdbf0

View File

@ -1399,6 +1399,16 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
encoded_url_map = video_info.get('url_encoded_fmt_stream_map', [''])[0] + ',' + video_info.get('adaptive_fmts', [''])[0] encoded_url_map = video_info.get('url_encoded_fmt_stream_map', [''])[0] + ',' + video_info.get('adaptive_fmts', [''])[0]
if 'rtmpe%3Dyes' in encoded_url_map: if 'rtmpe%3Dyes' in encoded_url_map:
raise ExtractorError('rtmpe downloads are not supported, see https://github.com/rg3/youtube-dl/issues/343 for more information.', expected=True) raise ExtractorError('rtmpe downloads are not supported, see https://github.com/rg3/youtube-dl/issues/343 for more information.', expected=True)
fmt_list = video_info.get('fmt_list', [''])[0]
if fmt_list:
for fmt in fmt_list.split(','):
spec = fmt.split('/')
width, height = spec[1].split('x')
self._formats[spec[0]].update({
'resolution': spec[1],
'width': int_or_none(width),
'height': int_or_none(height),
})
formats = [] formats = []
for url_data_str in encoded_url_map.split(','): for url_data_str in encoded_url_map.split(','):
url_data = compat_parse_qs(url_data_str) url_data = compat_parse_qs(url_data_str)