From c53f93ce0df1eb0a4053292a272405be22fadc44 Mon Sep 17 00:00:00 2001 From: slavikmipt Date: Thu, 5 Jul 2018 01:20:28 +0300 Subject: [PATCH] stable --- telegram_client_x.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram_client_x.py b/telegram_client_x.py index 2633ee9..eec2d64 100644 --- a/telegram_client_x.py +++ b/telegram_client_x.py @@ -202,7 +202,7 @@ class TelegramClientX(TelegramClient): file_size, part_count, part_size) with open(file, 'rb') if isinstance(file, str) else BytesIO(file) as stream: - threads_count = 2 + int((self._upload_threads_count - 2) * float(file_size) / 1024 * 1024 * 768) + threads_count = 2 + int((self._upload_threads_count - 2) * float(file_size) / (1024 * 1024 * 389)) threads_count = min(threads_count, self._upload_threads_count) threads_count = min(part_count, threads_count) upload_thread = []