Added peers and seeders count for bittorent downloads
Signed-off-by: lzzy12 <jhashivam2020@gmail.com>
This commit is contained in:
parent
96e623ef57
commit
8cbe2c29e4
|
|
@ -90,7 +90,11 @@ def get_readable_message():
|
||||||
if download.status() != MirrorStatus.STATUS_ARCHIVING:
|
if download.status() != MirrorStatus.STATUS_ARCHIVING:
|
||||||
msg += f"\n<code>{get_progress_bar_string(download)} {download.progress()}</code> of " \
|
msg += f"\n<code>{get_progress_bar_string(download)} {download.progress()}</code> of " \
|
||||||
f"{download.size()}" \
|
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"
|
msg += "\n\n"
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 bot.helper.ext_utils.bot_utils import *
|
||||||
from .download_helper import DownloadHelper
|
from .download_helper import DownloadHelper
|
||||||
from bot.helper.mirror_utils.status_utils.aria_download_status import AriaDownloadStatus
|
from bot.helper.mirror_utils.status_utils.aria_download_status import AriaDownloadStatus
|
||||||
|
|
@ -26,7 +26,9 @@ class AriaDownloadHelper(DownloadHelper):
|
||||||
if self.gid == gid:
|
if self.gid == gid:
|
||||||
if api.get_download(gid).followed_by_ids:
|
if api.get_download(gid).followed_by_ids:
|
||||||
self.gid = api.get_download(gid).followed_by_ids[0]
|
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()
|
update_all_messages()
|
||||||
LOGGER.info(f'Changed gid from {gid} to {self.gid}')
|
LOGGER.info(f'Changed gid from {gid} to {self.gid}')
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue