mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 05:19:41 +00:00
Stick to the offset and limit CdnFileHashes dictates (#222)
The old intersection method and allowing an arbitrary part size wasn't working properly. Assuming that Telegram will send a sha sum for the whole file, in the correct order, we can simply use their offsets to download the file.
This commit is contained in:
@@ -475,7 +475,7 @@ class TelegramBareClient:
|
||||
|
||||
try:
|
||||
if cdn_decrypter:
|
||||
result = cdn_decrypter.get_file(offset, part_size)
|
||||
result = cdn_decrypter.get_file()
|
||||
else:
|
||||
result = client(GetFileRequest(
|
||||
input_location, offset, part_size
|
||||
@@ -484,8 +484,7 @@ class TelegramBareClient:
|
||||
if isinstance(result, FileCdnRedirect):
|
||||
cdn_decrypter, result = \
|
||||
CdnDecrypter.prepare_decrypter(
|
||||
client, TelegramBareClient, result,
|
||||
offset, part_size
|
||||
client, TelegramBareClient, result
|
||||
)
|
||||
|
||||
except FileMigrateError as e:
|
||||
|
Reference in New Issue
Block a user