This commit is contained in:
ClosedPort22 2024-05-01 12:57:18 +05:30 committed by GitHub
commit 258711bc64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 4 deletions

View File

@ -4364,13 +4364,12 @@ class YoutubeDL:
else:
self.to_screen(f'[info] Downloading {thumb_display_id} ...')
try:
uf = self.urlopen(Request(t['url'], headers=t.get('http_headers', {})))
thumb_copy = t.copy()
self.to_screen(f'[info] Writing {thumb_display_id} to: {thumb_filename}')
with open(encodeFilename(thumb_filename), 'wb') as thumbf:
shutil.copyfileobj(uf, thumbf)
self.dl(thumb_filename, thumb_copy)
ret.append((thumb_filename, thumb_filename_final))
t['filepath'] = thumb_filename
except network_exceptions as err:
except (DownloadError, ExtractorError, IOError, OSError, ValueError) + network_exceptions as err:
if isinstance(err, HTTPError) and err.status == 404:
self.to_screen(f'[info] {thumb_display_id.title()} does not exist')
else: