1
0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-07-02 12:02:52 -05:00

[extractor] Allow http_headers to be specified for thumbnails

This commit is contained in:
pukkandan
2022-02-11 23:30:48 +05:30
parent dca4f46274
commit 297e9952b6
2 changed files with 4 additions and 1 deletions

View File

@ -3860,7 +3860,7 @@ class YoutubeDL(object):
else:
self.to_screen(f'[info] Downloading {thumb_display_id} ...')
try:
uf = self.urlopen(t['url'])
uf = self.urlopen(sanitized_Request(t['url'], headers=t.get('http_headers', {})))
self.to_screen(f'[info] Writing {thumb_display_id} to: {thumb_filename}')
with open(encodeFilename(thumb_filename), 'wb') as thumbf:
shutil.copyfileobj(uf, thumbf)