From 080039d3f5580c7472fe8ec0bf6d5862663992bd Mon Sep 17 00:00:00 2001 From: FA Tulloh <77918734+yourtulloh@users.noreply.github.com> Date: Sun, 9 May 2021 16:48:25 +0800 Subject: [PATCH] Some fixes (#83) --- bot/helper/mirror_utils/download_utils/aria2_download.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bot/helper/mirror_utils/download_utils/aria2_download.py b/bot/helper/mirror_utils/download_utils/aria2_download.py index ae9e60efdb9..82e9a6608aa 100644 --- a/bot/helper/mirror_utils/download_utils/aria2_download.py +++ b/bot/helper/mirror_utils/download_utils/aria2_download.py @@ -34,14 +34,15 @@ def __onDownloadStarted(self, api, gid): dl.getListener().onDownloadError(f'File is already available in drive.\n\n') sendMarkup("Here are the search results:", dl.getListener().bot, dl.getListener().update, button) aria2.remove([download]) + return size = download.total_length if ENABLE_FILESIZE_LIMIT: if size / 1024 / 1024 / 1024 > MAX_TORRENT_SIZE: - LOGGER.info(f" Download size Exceeded: {gid}") + LOGGER.info(f"Download size Exceeded: {gid}") dl.getListener().onDownloadError(f'File size {get_readable_file_size(size)} larger than Maximum Allowed size {MAX_TORRENT_SIZE}GB') aria2.remove([download]) - return + return update_all_messages() def __onDownloadComplete(self, api: API, gid):