mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-04 20:20:23 +03:00
Fix modifying stripped sizes in place
This commit is contained in:
parent
b51a280dc9
commit
3e326af8ea
|
@ -342,10 +342,11 @@ class DownloadMethods(UserMethods):
|
||||||
f = open(file, 'wb')
|
f = open(file, 'wb')
|
||||||
else:
|
else:
|
||||||
f = file
|
f = file
|
||||||
if isinstance(size, types.PhotoStrippedSize):
|
|
||||||
size.bytes = utils.stripped_to_photo(size.bytes)
|
|
||||||
try:
|
try:
|
||||||
f.write(size.bytes)
|
f.write(utils.stripped_photo_to_jpg(size.bytes)
|
||||||
|
if isinstance(size, types.PhotoStrippedSize)
|
||||||
|
else size.bytes)
|
||||||
finally:
|
finally:
|
||||||
if isinstance(file, str):
|
if isinstance(file, str):
|
||||||
f.close()
|
f.close()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user