From 4ba5e630349f693bf1a89995fde0617996b78209 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 15 Dec 2018 08:51:20 +0100 Subject: [PATCH] Report offset instead of 0 in case file size is missing (for file_id) --- pyrogram/client/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 8b0acd22..2094eb9c 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -1296,7 +1296,7 @@ class Client(Methods, BaseClient): offset += limit if progress: - progress(self, min(offset, size), size, *progress_args) + progress(self, min(offset, size) if size != 0 else offset, size, *progress_args) r = session.send( functions.upload.GetFile( @@ -1378,7 +1378,7 @@ class Client(Methods, BaseClient): offset += limit if progress: - progress(self, min(offset, size), size, *progress_args) + progress(self, min(offset, size) if size != 0 else offset, size, *progress_args) if len(chunk) < limit: break