Don't attempt thumb download if there is no thumb

This commit is contained in:
Lonami Exo 2023-07-22 10:52:03 +02:00
parent 438aff3545
commit 131f021d51

View File

@ -886,6 +886,9 @@ class DownloadMethods:
else:
file = self._get_proper_filename(file, 'photo', '.jpg', date=date)
size = self._get_thumb(document.thumbs, thumb)
if not size or isinstance(size, types.PhotoSizeEmpty):
return
if isinstance(size, (types.PhotoCachedSize, types.PhotoStrippedSize)):
return self._download_cached_photo_size(size, file)