Use headers and cookies when downloading subtitles ()

pull/187/head
Damiano Amatruda 2021-03-15 18:13:16 +01:00 zatwierdzone przez pukkandan
rodzic fe845284c4
commit 4690688658
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0F00D95A001F4698
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -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')])