diff --git a/bot/helper/ext_utils/bot_utils.py b/bot/helper/ext_utils/bot_utils.py index 83121c257..ea8f598ad 100644 --- a/bot/helper/ext_utils/bot_utils.py +++ b/bot/helper/ext_utils/bot_utils.py @@ -90,7 +90,11 @@ def get_readable_message(): if download.status() != MirrorStatus.STATUS_ARCHIVING: msg += f"\n{get_progress_bar_string(download)} {download.progress()} of " \ f"{download.size()}" \ - f" at {download.speed()}, ETA: {download.eta()}" + f" at {download.speed()}, ETA: {download.eta()} " + if download.status() == MirrorStatus.STATUS_DOWNLOADING: + if hasattr(download, 'is_torrent'): + msg += f"| P: {download.download().connections} " \ + f"| S: {download.download().num_seeders}" msg += "\n\n" return msg diff --git a/bot/helper/mirror_utils/download_utils/aria2_download.py b/bot/helper/mirror_utils/download_utils/aria2_download.py index 974218d21..2817ba9e3 100644 --- a/bot/helper/mirror_utils/download_utils/aria2_download.py +++ b/bot/helper/mirror_utils/download_utils/aria2_download.py @@ -1,4 +1,4 @@ -from bot import aria2 +from bot import aria2,download_dict,download_dict_lock from bot.helper.ext_utils.bot_utils import * from .download_helper import DownloadHelper from bot.helper.mirror_utils.status_utils.aria_download_status import AriaDownloadStatus @@ -26,7 +26,9 @@ def __onDownloadComplete(self, api: API, gid): if self.gid == gid: if api.get_download(gid).followed_by_ids: self.gid = api.get_download(gid).followed_by_ids[0] - download_dict[self._listener.uid] = AriaDownloadStatus(self.gid, self._listener) + with download_dict_lock: + download_dict[self._listener.uid] = AriaDownloadStatus(self.gid, self._listener) + download_dict[self._listener.uid].is_torrent =True update_all_messages() LOGGER.info(f'Changed gid from {gid} to {self.gid}') else: