diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-11-13 22:06:16 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-11-13 22:22:10 +0700 |
commit | 690355551c084a942db9820b4c83b65f73fb2d4c (patch) | |
tree | 902746d17246418f61c577c434d76cc0f3bca98b /youtube_dl/downloader/hls.py | |
parent | 754e6c8322705cd9953c5f1032ed9dae35c38b27 (diff) |
[downoader/fragment,f4m,hls] Add internal support for custom HTTP headers
Diffstat (limited to 'youtube_dl/downloader/hls.py')
-rw-r--r-- | youtube_dl/downloader/hls.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube_dl/downloader/hls.py b/youtube_dl/downloader/hls.py index 541b92ee1..7373ec05f 100644 --- a/youtube_dl/downloader/hls.py +++ b/youtube_dl/downloader/hls.py @@ -59,7 +59,8 @@ class HlsFD(FragmentFD): def real_download(self, filename, info_dict): man_url = info_dict['url'] self.to_screen('[%s] Downloading m3u8 manifest' % self.FD_NAME) - manifest = self.ydl.urlopen(man_url).read() + + manifest = self.ydl.urlopen(self._prepare_url(info_dict, man_url)).read() s = manifest.decode('utf-8', 'ignore') @@ -112,7 +113,10 @@ class HlsFD(FragmentFD): count = 0 while count <= fragment_retries: try: - success = ctx['dl'].download(frag_filename, {'url': frag_url}) + success = ctx['dl'].download(frag_filename, { + 'url': frag_url, + 'http_headers': info_dict.get('http_headers'), + }) if not success: return False down, frag_sanitized = sanitize_open(frag_filename, 'rb') |