From a7622324dd39795fa028337c78e5d652eb2563f6 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 9 Oct 2017 12:00:14 +0200 Subject: [PATCH] Remove unnecessary offset_index variable on .download_file --- telethon/telegram_bare_client.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/telethon/telegram_bare_client.py b/telethon/telegram_bare_client.py index bc56fd42..d24f6635 100644 --- a/telethon/telegram_bare_client.py +++ b/telethon/telegram_bare_client.py @@ -688,10 +688,8 @@ class TelegramBareClient: cdn_decrypter = None try: - offset_index = 0 + offset = 0 while True: - offset = offset_index * part_size - try: if cdn_decrypter: result = cdn_decrypter.get_file() @@ -710,7 +708,7 @@ class TelegramBareClient: client = self._get_exported_client(e.new_dc) continue - offset_index += 1 + offset += part_size # If we have received no data (0 bytes), the file is over # So there is nothing left to download and write