aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/downloader/f4m.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-11-13 22:06:16 +0700
committerSergey M․ <dstftw@gmail.com>2016-11-13 22:22:10 +0700
commit690355551c084a942db9820b4c83b65f73fb2d4c (patch)
tree902746d17246418f61c577c434d76cc0f3bca98b /youtube_dl/downloader/f4m.py
parent754e6c8322705cd9953c5f1032ed9dae35c38b27 (diff)
[downoader/fragment,f4m,hls] Add internal support for custom HTTP headers
Diffstat (limited to 'youtube_dl/downloader/f4m.py')
-rw-r--r--youtube_dl/downloader/f4m.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube_dl/downloader/f4m.py b/youtube_dl/downloader/f4m.py
index 80c21d40b..688e086eb 100644
--- a/youtube_dl/downloader/f4m.py
+++ b/youtube_dl/downloader/f4m.py
@@ -314,7 +314,8 @@ class F4mFD(FragmentFD):
man_url = info_dict['url']
requested_bitrate = info_dict.get('tbr')
self.to_screen('[%s] Downloading f4m manifest' % self.FD_NAME)
- urlh = self.ydl.urlopen(man_url)
+
+ urlh = self.ydl.urlopen(self._prepare_url(info_dict, man_url))
man_url = urlh.geturl()
# Some manifests may be malformed, e.g. prosiebensat1 generated manifests
# (see https://github.com/rg3/youtube-dl/issues/6215#issuecomment-121704244
@@ -387,7 +388,10 @@ class F4mFD(FragmentFD):
url_parsed = base_url_parsed._replace(path=base_url_parsed.path + name, query='&'.join(query))
frag_filename = '%s-%s' % (ctx['tmpfilename'], name)
try:
- success = ctx['dl'].download(frag_filename, {'url': url_parsed.geturl()})
+ success = ctx['dl'].download(frag_filename, {
+ 'url': url_parsed.geturl(),
+ 'http_headers': info_dict.get('http_headers'),
+ })
if not success:
return False
(down, frag_sanitized) = sanitize_open(frag_filename, 'rb')