mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-30 17:59:55 +03:00
Fix Md5ChecksumInvalidError for small files
This commit is contained in:
parent
4b16183d2b
commit
d9c3e802ab
|
@ -606,16 +606,16 @@ class UploadMethods:
|
||||||
|
|
||||||
pos += len(part)
|
pos += len(part)
|
||||||
|
|
||||||
|
# Encryption part if needed
|
||||||
|
if key and iv:
|
||||||
|
part = AES.encrypt_ige(part, key, iv)
|
||||||
|
|
||||||
if not is_big:
|
if not is_big:
|
||||||
# Bit odd that MD5 is only needed for small files and not
|
# Bit odd that MD5 is only needed for small files and not
|
||||||
# big ones with more chance for corruption, but that's
|
# big ones with more chance for corruption, but that's
|
||||||
# what Telegram wants.
|
# what Telegram wants.
|
||||||
hash_md5.update(part)
|
hash_md5.update(part)
|
||||||
|
|
||||||
# Encryption part if needed
|
|
||||||
if key and iv:
|
|
||||||
part = AES.encrypt_ige(part, key, iv)
|
|
||||||
|
|
||||||
# The SavePartRequest is different depending on whether
|
# The SavePartRequest is different depending on whether
|
||||||
# the file is too large or not (over or less than 10MB)
|
# the file is too large or not (over or less than 10MB)
|
||||||
if is_big:
|
if is_big:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user