mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
Use headers and cookies when downloading subtitles (#173)
This commit is contained in:
parent
fe845284c4
commit
4690688658
1 changed files with 4 additions and 1 deletions
|
@ -2141,7 +2141,10 @@ def dl(name, info, subtitle=False):
|
||||||
fd.add_progress_hook(ph)
|
fd.add_progress_hook(ph)
|
||||||
if self.params.get('verbose'):
|
if self.params.get('verbose'):
|
||||||
self.to_screen('[debug] Invoking downloader on %r' % info.get('url'))
|
self.to_screen('[debug] Invoking downloader on %r' % info.get('url'))
|
||||||
return fd.download(name, info, subtitle)
|
new_info = dict(info)
|
||||||
|
if new_info.get('http_headers') is None:
|
||||||
|
new_info['http_headers'] = self._calc_headers(new_info)
|
||||||
|
return fd.download(name, new_info, subtitle)
|
||||||
|
|
||||||
subtitles_are_requested = any([self.params.get('writesubtitles', False),
|
subtitles_are_requested = any([self.params.get('writesubtitles', False),
|
||||||
self.params.get('writeautomaticsub')])
|
self.params.get('writeautomaticsub')])
|
||||||
|
|
Loading…
Reference in a new issue