From 50e70edd6e91076e5be2785adea0b3b9e719df54 Mon Sep 17 00:00:00 2001 From: Lunatic Date: Sat, 17 Aug 2024 09:11:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(torrenttransfer):=20=E8=BD=AC=E7=A7=BB?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E4=BF=9D=E7=95=99=E5=85=A8=E9=83=A8tracker?= =?UTF-8?q?=E4=BB=A5=E6=8F=90=E9=AB=98=E5=8F=AF=E8=BE=BE=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了在转移torrent时仅保留第一个tracker的问题,此更新确保所有tracker都被保留,从而提高在不同网络条件下的可达性。 --- package.json | 1 + plugins/torrenttransfer/__init__.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 38ba44a..d381d18 100644 --- a/package.json +++ b/package.json @@ -335,6 +335,7 @@ "author": "jxxghp", "level": 2, "history": { + "v1.5":"修复在转移时只保留了第一个tracker,导致红种问题。此修复确保保留所有的tracker,以提高在不同网络条件下的可达性。", "v1.4": "支持自动删除源下载器在目的下载器中存在的种子" } }, diff --git a/plugins/torrenttransfer/__init__.py b/plugins/torrenttransfer/__init__.py index c304a59..fa22714 100644 --- a/plugins/torrenttransfer/__init__.py +++ b/plugins/torrenttransfer/__init__.py @@ -27,7 +27,7 @@ class TorrentTransfer(_PluginBase): # 插件图标 plugin_icon = "seed.png" # 插件版本 - plugin_version = "1.4" + plugin_version = "1.5" # 插件作者 plugin_author = "jxxghp" # 作者主页 @@ -724,6 +724,9 @@ class TorrentTransfer(_PluginBase): and fastresume_trackers[0]: # 重新赋值 torrent_main['announce'] = fastresume_trackers[0][0] + # 保留其他tracker,避免单一tracker无法连接 + if len(fastresume_trackers) > 1 or len(fastresume_trackers[0]) > 1: + torrent_main['announce-list'] = fastresume_trackers # 替换种子文件路径 torrent_file = settings.TEMP_PATH / f"{torrent_item.get('hash')}.torrent" # 编码并保存到临时文件