diff options
author | remitamine <remitamine@gmail.com> | 2016-03-02 14:23:17 +0100 |
---|---|---|
committer | remitamine <remitamine@gmail.com> | 2016-03-02 16:05:05 +0100 |
commit | 82156fdbf0913c75181484dcc813565713bf78e9 (patch) | |
tree | 4c93ef3b21e8bc6a11426b6bd963b212d65e31ec /youtube_dl/extractor/youtube.py | |
parent | 61140904184f3fe84eea21e698c64d6b4fe7c889 (diff) |
[youtube] extract width and height from fmt_list
Diffstat (limited to 'youtube_dl/extractor/youtube.py')
-rw-r--r-- | youtube_dl/extractor/youtube.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index ba339b67d..56e6bd096 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -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] 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) + 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 = [] for url_data_str in encoded_url_map.split(','): url_data = compat_parse_qs(url_data_str) |