From 449bbee08c6589a9c888a47a02487466b5792864 Mon Sep 17 00:00:00 2001 From: Shrimadhav U K Date: Sun, 13 Sep 2020 17:23:02 +0530 Subject: [PATCH] try to fix, zero division error --- tobrot/helper_funcs/display_progress.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tobrot/helper_funcs/display_progress.py b/tobrot/helper_funcs/display_progress.py index da1b01cd..5e1a80ca 100644 --- a/tobrot/helper_funcs/display_progress.py +++ b/tobrot/helper_funcs/display_progress.py @@ -33,6 +33,8 @@ async def progress_for_pyrogram( # if round(current / total * 100, 0) % 5 == 0: percentage = current * 100 / total elapsed_time = round(diff) + if elapsed_time == 0: + return speed = current / elapsed_time time_to_completion = round((total - current) / speed) estimated_total_time = elapsed_time + time_to_completion