From f60ce503386c7f53c4e6de913c99d6b219200e64 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 19 Aug 2023 12:59:17 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=A7=A3=E6=9E=90fastresume=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/torrenttransfer/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/plugins/torrenttransfer/__init__.py b/app/plugins/torrenttransfer/__init__.py index a1eab2ad..6695f88a 100644 --- a/app/plugins/torrenttransfer/__init__.py +++ b/app/plugins/torrenttransfer/__init__.py @@ -583,16 +583,16 @@ class TorrentTransfer(_PluginBase): # 尝试补充trackers try: # 解析fastresume文件 - torrent_fastresume = Bencode.read_file(fastresume_file, byte_keys={'pieces'}) + torrent_fastresume = Bencode.read_file(fastresume_file) # 读取trackers fastresume_trackers = torrent_fastresume.get("trackers") if fastresume_trackers: # 重新赋值 - torrent_main.announce_urls = fastresume_trackers + torrent_main.announce_urls = fastresume_trackers[0] # 替换种子文件路径 torrent_file = settings.TEMP_PATH / f"{hash_item.get('hash')}.torrent" # 编码并保存到临时文件 - Torrent.to_file(torrent_file) + torrent_main.to_file(torrent_file) except Exception as err: logger.error(f"解析fastresume文件 {fastresume_file} 失败:{err}") fail += 1