From 1679648c4ed916a185a67b7e98e562c2ae9369e7 Mon Sep 17 00:00:00 2001
From: yasirarism <55983182+yasirarism@users.noreply.github.com>
Date: Tue, 6 Jun 2023 14:33:19 +0000
Subject: [PATCH] Fix
---
misskaty/plugins/download_upload.py | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/misskaty/plugins/download_upload.py b/misskaty/plugins/download_upload.py
index d2b39974..c431b968 100644
--- a/misskaty/plugins/download_upload.py
+++ b/misskaty/plugins/download_upload.py
@@ -110,20 +110,20 @@ async def download(client, message):
)
estimated_total_time = downloader.get_eta(human=True)
- # try:
- current_message = "Trying to download...\n"
- current_message += f"URL: {url}\n"
- current_message += f"File Name: {custom_file_name}\n"
- current_message += f"Speed: {speed}\n"
- current_message += f"{progress_str}\n"
- current_message += f"{humanbytes(downloaded)} of {humanbytes(total_length)}\n"
- current_message += f"ETA: {estimated_total_time}"
- if round(diff % 10.00) == 0 and current_message != display_message:
- await pesan.edit(disable_web_page_preview=True, text=current_message)
- display_message = current_message
- await asyncio.sleep(10)
- # except Exception as e:
- # LOGGER.info(str(e))
+ try:
+ current_message = "Trying to download...\n"
+ current_message += f"URL: {url}\n"
+ current_message += f"File Name: {custom_file_name}\n"
+ current_message += f"Speed: {speed}\n"
+ current_message += f"{progress_str}\n"
+ current_message += f"{downloaded} of {humanbytes(total_length)}\n"
+ current_message += f"ETA: {estimated_total_time}"
+ if round(diff % 10.00) == 0 and current_message != display_message:
+ await pesan.edit(disable_web_page_preview=True, text=current_message)
+ display_message = current_message
+ await asyncio.sleep(10)
+ except Exception as e:
+ LOGGER.info(str(e))
if os.path.exists(download_file_path):
end_t = datetime.now()
ms = (end_t - start_t).seconds