The only downloader you need. 下载器的集大成者。
TypeScript asyncasynciobittorentbtcross-platformdownload-managerdownloaderfluent-designftphttp3magnetpyqtpyside6pythonqtquicreactsoftwarestreaming
feat(bittorrent_pack): 添加 Web Tracker 自动初始化功能
XiaoYouChRcd9267283f63
diff --git a/features/bittorrent_pack/pack.py b/features/bittorrent_pack/pack.pyindex 97a473a7..4fcaacbd 100644--- a/features/bittorrent_pack/pack.py+++ b/features/bittorrent_pack/pack.py@@ -1,9 +1,12 @@from urllib.parse import urlparse+from loguru import logger+from app.bases.interfaces import FeaturePack+from app.services.core_service import coreServicefrom .cards import BitTorrentResultCard, BitTorrentTaskCard-from .config import bittorrentConfig+from .config import bittorrentConfig, getCachedWebTrackers, refreshConfiguredWebTrackersfrom .task import BitTorrentTask, parse, resolveLocalTorrentPath@@ -25,6 +28,15 @@ class BitTorrentPack(FeaturePack):taskType = BitTorrentTaskconfig = bittorrentConfig+ def load(self, mainWindow):+ if getCachedWebTrackers():+ return++ coreService.runCoroutine(+ refreshConfiguredWebTrackers(),+ self._onDefaultWebTrackersLoaded,+ )+def canHandle(self, url: str) -> bool:return _isTorrentUrl(url)@@ -36,3 +48,11 @@ class BitTorrentPack(FeaturePack):def createResultCard(self, task: BitTorrentTask, parent=None):return BitTorrentResultCard(task, parent)++ def _onDefaultWebTrackersLoaded(self, result, error: str | None):+ if error:+ logger.warning("初始化 Web Tracker 失败: {}", error)+ return++ logger.info("已自动初始化 {} 条 Web Tracker", len(result or []))+ bittorrentConfig.webTrackerCard.refreshContent()