diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-07-16 01:15:15 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-07-16 01:15:15 +0600 |
commit | 70f0f5a8ca53d4426fc079b3ab46e9d4a8e81ea4 (patch) | |
tree | 7d6cdf8fe702fcfd24423515a17599ec885609eb /youtube_dl/extractor/common.py | |
parent | cc357c4db8112ff6736a227b47fb9527d327797f (diff) |
[extractor/common] Recursively extract child f4m manifests
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r-- | youtube_dl/extractor/common.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 78e5cf8d0..e3c610aa4 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -27,6 +27,7 @@ from ..utils import ( bug_reports_message, clean_html, compiled_regex_type, + determine_ext, ExtractorError, fix_xml_ampersands, float_or_none, @@ -855,6 +856,13 @@ class InfoExtractor(object): manifest_url = ( media_url if media_url.startswith('http://') or media_url.startswith('https://') else ('/'.join(manifest_url.split('/')[:-1]) + '/' + media_url)) + # If media_url is itself a f4m manifest do the recursive extraction + # since bitrates in parent manifest (this one) and media_url manifest + # may differ leading to inability to resolve the format by requested + # bitrate in f4m downloader + if determine_ext(manifest_url) == 'f4m': + formats.extend(self._extract_f4m_formats(manifest_url, video_id, preference, f4m_id)) + continue tbr = int_or_none(media_el.attrib.get('bitrate')) formats.append({ 'format_id': '-'.join(filter(None, [f4m_id, compat_str(i if tbr is None else tbr)])), |