aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/downloader/fragment.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/fragment.py
parent754e6c8322705cd9953c5f1032ed9dae35c38b27 (diff)
[downoader/fragment,f4m,hls] Add internal support for custom HTTP headers
Diffstat (limited to 'youtube_dl/downloader/fragment.py')
-rw-r--r--youtube_dl/downloader/fragment.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/downloader/fragment.py b/youtube_dl/downloader/fragment.py
index 84aacf7db..60df627a6 100644
--- a/youtube_dl/downloader/fragment.py
+++ b/youtube_dl/downloader/fragment.py
@@ -9,6 +9,7 @@ from ..utils import (
error_to_compat_str,
encodeFilename,
sanitize_open,
+ sanitized_Request,
)
@@ -37,6 +38,10 @@ class FragmentFD(FileDownloader):
def report_skip_fragment(self, fragment_name):
self.to_screen('[download] Skipping fragment %s...' % fragment_name)
+ def _prepare_url(self, info_dict, url):
+ headers = info_dict.get('http_headers')
+ return sanitized_Request(url, None, headers) if headers else url
+
def _prepare_and_start_frag_download(self, ctx):
self._prepare_frag_download(ctx)
self._start_frag_download(ctx)