diff options
author | Remita Amine <[email protected]> | 2016-07-06 09:11:46 +0100 |
---|---|---|
committer | Remita Amine <[email protected]> | 2016-07-06 09:11:46 +0100 |
commit | ab49d7a9fae08763de549f85ba138b22f9122a99 (patch) | |
tree | d4a2c796088234b9553db074ccbd5ae1752a540c /youtube_dl/extractor/dailymotion.py | |
parent | b4173f1551c47f64745cb91451c46891e2aaac16 (diff) | |
download | youtube-dl-ab49d7a9fae08763de549f85ba138b22f9122a99.tar.gz youtube-dl-ab49d7a9fae08763de549f85ba138b22f9122a99.zip |
use mimetype2ext to determine manifest ext in multiple extractors
Diffstat (limited to 'youtube_dl/extractor/dailymotion.py')
-rw-r--r-- | youtube_dl/extractor/dailymotion.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/youtube_dl/extractor/dailymotion.py b/youtube_dl/extractor/dailymotion.py index 2e6226ea0..15bfc59b2 100644 --- a/youtube_dl/extractor/dailymotion.py +++ b/youtube_dl/extractor/dailymotion.py @@ -16,6 +16,7 @@ from ..utils import ( sanitized_Request, str_to_int, unescapeHTML, + mimetype2ext, ) @@ -153,18 +154,19 @@ class DailymotionIE(DailymotionBaseInfoExtractor): type_ = media.get('type') if type_ == 'application/vnd.lumberjack.manifest': continue - ext = determine_ext(media_url) - if type_ == 'application/x-mpegURL' or ext == 'm3u8': + ext = mimetype2ext(type_) or determine_ext(media_url) + if ext == 'm3u8': formats.extend(self._extract_m3u8_formats( media_url, video_id, 'mp4', preference=-1, m3u8_id='hls', fatal=False)) - elif type_ == 'application/f4m' or ext == 'f4m': + elif ext == 'f4m': formats.extend(self._extract_f4m_formats( media_url, video_id, preference=-1, f4m_id='hds', fatal=False)) else: f = { 'url': media_url, 'format_id': 'http-%s' % quality, + 'ext': ext, } m = re.search(r'H264-(?P<width>\d+)x(?P<height>\d+)', media_url) if m: |