diff options
author | Remita Amine <remitamine@gmail.com> | 2016-08-28 17:51:53 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2016-08-28 17:51:53 +0100 |
commit | b8079a40bc61326b17a672b073dce6cdfa791fb5 (patch) | |
tree | c8f0d0afc80b8b9901fdcbad5a39297bf76bd13e /youtube_dl/extractor/turner.py | |
parent | 5bc8a73af69f4aac8b2df6f7c23ecfb4ee72e518 (diff) |
[turner] fix secure m3u8 formats downloading
Diffstat (limited to 'youtube_dl/extractor/turner.py')
-rw-r--r-- | youtube_dl/extractor/turner.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/youtube_dl/extractor/turner.py b/youtube_dl/extractor/turner.py index 0d4271f11..108caa9d8 100644 --- a/youtube_dl/extractor/turner.py +++ b/youtube_dl/extractor/turner.py @@ -11,6 +11,7 @@ from ..utils import ( parse_duration, xpath_attr, update_url_query, + compat_urlparse, ) @@ -87,8 +88,18 @@ class TurnerBaseIE(InfoExtractor): if ext == 'smil': formats.extend(self._extract_smil_formats(video_url, video_id, fatal=False)) elif ext == 'm3u8': - formats.extend(self._extract_m3u8_formats( - video_url, video_id, 'mp4', m3u8_id=format_id, fatal=False)) + m3u8_formats = self._extract_m3u8_formats( + video_url, video_id, 'mp4', m3u8_id=format_id, fatal=False) + if m3u8_formats: + # Sometimes final URLs inside m3u8 are unsigned, let's fix this + # ourselves + qs = compat_urlparse.urlparse(video_url).query + if qs: + query = compat_urlparse.parse_qs(qs) + for m3u8_format in m3u8_formats: + m3u8_format['url'] = update_url_query(m3u8_format['url'], query) + m3u8_format['extra_param_to_segment_url'] = qs + formats.extend(m3u8_formats) elif ext == 'f4m': formats.extend(self._extract_f4m_formats( update_url_query(video_url, {'hdcore': '3.7.0'}), |