diff options
author | Damiano Amatruda <damiano.amatruda@outlook.com> | 2021-03-15 18:13:16 +0100 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-03-20 09:34:52 +0530 |
commit | 4690688658af3d5b3f77701444f4c27cee5057fd (patch) | |
tree | d9a02045f6da34546b03f768bbc9fd0724a16b18 | |
parent | fe845284c4f01345c6dfaf0631860e8fe0534df3 (diff) |
Use headers and cookies when downloading subtitles (#173)
-rw-r--r-- | yt_dlp/YoutubeDL.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 482f1fbac..6c2b9eb57 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -2141,7 +2141,10 @@ class YoutubeDL(object): fd.add_progress_hook(ph) if self.params.get('verbose'): 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), self.params.get('writeautomaticsub')]) |