diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-03-13 03:16:08 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-03-13 03:16:08 +0600 |
commit | 0fdbb3322b263aeb66aa9a774fa59a9bad33321c (patch) | |
tree | 4b2cb0030649260c7fe0a19e55e445be688ffb62 | |
parent | e9c8999ede2e07c64f2b592b12158d763dc933c8 (diff) | |
download | youtube-dl-0fdbb3322b263aeb66aa9a774fa59a9bad33321c.tar.xz |
[extractor/common] Add _parse_f4m_formats routine
-rw-r--r-- | youtube_dl/extractor/common.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 0b8b906ab..ecd7da767 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -973,6 +973,13 @@ class InfoExtractor(object): if manifest is False: return [] + return self._parse_f4m_formats( + manifest, manifest_url, video_id, preference=preference, f4m_id=f4m_id, + transform_source=transform_source, fatal=fatal) + + def _parse_f4m_formats(self, manifest, manifest_url, video_id, preference=None, f4m_id=None, + transform_source=lambda s: fix_xml_ampersands(s).strip(), + fatal=True): formats = [] manifest_version = '1.0' media_nodes = manifest.findall('{http://ns.adobe.com/f4m/1.0}media') @@ -998,7 +1005,8 @@ class InfoExtractor(object): # bitrate in f4m downloader if determine_ext(manifest_url) == 'f4m': formats.extend(self._extract_f4m_formats( - manifest_url, video_id, preference, f4m_id, fatal=fatal)) + manifest_url, video_id, preference=preference, f4m_id=f4m_id, + transform_source=transform_source, fatal=fatal)) continue tbr = int_or_none(media_el.attrib.get('bitrate')) formats.append({ |