From d6c28ad6ca0a1301b0c0fd30c124d7855d5f49f3 Mon Sep 17 00:00:00 2001 From: Aza Maulana Date: Tue, 29 Sep 2020 22:51:39 +0700 Subject: [PATCH] issue #3: adding torrent seeder and progress info --- bot/handlers/leech_handler.py | 2 ++ bot/locals/default.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bot/handlers/leech_handler.py b/bot/handlers/leech_handler.py index d54b10f4..34afb7e6 100644 --- a/bot/handlers/leech_handler.py +++ b/bot/handlers/leech_handler.py @@ -100,9 +100,11 @@ async def progress_dl(message : Message, aria2_api : aria2.aria2, gid : int, pre text = LOCAL.ARIA2_DOWNLOAD_STATUS.format( name = download.name, block = block, + percentage = download.progress_string(), total_size = download.total_length_string(), download_speed = download.download_speed_string(), upload_speed = download.upload_speed_string(), + seeder = download.num_seeders if download.is_torrent else 1, eta = download.eta_string(), gid = download.gid ) diff --git a/bot/locals/default.py b/bot/locals/default.py index 5a2fbdb6..e489d8ad 100644 --- a/bot/locals/default.py +++ b/bot/locals/default.py @@ -9,7 +9,7 @@ 'LEECH_LIST_MESSAGE_HEADER' : 'Leech Status', 'LEECH_LIST_FORMAT' : 'Name: {name}\nStatus: {status}\nID: {gid}\n\n', 'ARIA2_CHECKING_LINK' : "checking...", - 'ARIA2_DOWNLOAD_STATUS' : "Downloading : {name}\n{block}\nSize : {total_size}\nDN : {download_speed} / UP : {upload_speed}\nETA : {eta}\nID : {gid}", + 'ARIA2_DOWNLOAD_STATUS' : "Downloading : {name}\n{block} {percentage}%\nSize : {total_size}\nDN : {download_speed} / UP : {upload_speed}\nSeeder : {seeder}\nETA : {eta}\nID : {gid}", 'ARIA2_DOWNLOAD_SUCCESS' : 'File downloaded : {name}', 'ARIA2_DOWNLOAD_CANCELED' : 'Download canceled : {name}', 'ARIA2_DEAD_LINK' : 'Download auto canceled : {name}\nYour Torrent/Link is Dead.',