From b889dd493997f7933c785e956d2bf857b52d4c31 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sun, 11 Jun 2023 10:35:47 +0800 Subject: [PATCH] fix --- app/modules/telegram/telegram.py | 5 +++-- app/modules/wechat/wechat.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/modules/telegram/telegram.py b/app/modules/telegram/telegram.py index 2a38e950..6037f632 100644 --- a/app/modules/telegram/telegram.py +++ b/app/modules/telegram/telegram.py @@ -14,7 +14,7 @@ from app.core.metainfo import MetaInfo from app.log import logger from app.utils.http import RequestUtils from app.utils.singleton import Singleton - +from app.utils.string import StringUtils apihelper.proxy = settings.PROXY @@ -146,7 +146,8 @@ class Telegram(metaclass=Singleton): link = torrent.page_url title = f"{meta.get_season_episode_string()} " \ f"{meta.get_resource_type_string()} " \ - f"{meta.get_resource_team_string()}" + f"{meta.get_resource_team_string()} " \ + f"{StringUtils.str_filesize(torrent.size)}" title = re.sub(r"\s+", " ", title).strip() free = torrent.get_volume_factor_string() seeder = f"{torrent.seeders}↑" diff --git a/app/modules/wechat/wechat.py b/app/modules/wechat/wechat.py index ddc7ca46..88de1c2e 100644 --- a/app/modules/wechat/wechat.py +++ b/app/modules/wechat/wechat.py @@ -10,6 +10,7 @@ from app.core.metainfo import MetaInfo from app.log import logger from app.utils.http import RequestUtils from app.utils.singleton import Singleton +from app.utils.string import StringUtils lock = threading.Lock() @@ -215,7 +216,8 @@ class WeChat(metaclass=Singleton): torrent_title = f"{index}.【{torrent.site_name}】" \ f"{meta.get_season_episode_string()} " \ f"{meta.get_resource_type_string()} " \ - f"{meta.get_resource_team_string()}" \ + f"{meta.get_resource_team_string()} " \ + f"{StringUtils.str_filesize(torrent.size)} " \ f"{torrent.get_volume_factor_string()} " \ f"{torrent.seeders}↑" title = re.sub(r"\s+", " ", title).strip()