[downoader/fragment,f4m,hls] Add internal support for custom HTTP headers
This commit is contained in:
parent
754e6c8322
commit
690355551c
3 changed files with 17 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue