From 2b8f5553ecff83899d06ce0afef6a9befefdaf82 Mon Sep 17 00:00:00 2001 From: ljmeng Date: Wed, 27 Mar 2024 23:29:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BE=9D=E8=B5=96=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- plugins/crossseed/__init__.py | 2 +- plugins/crossseed/cross_seed_helper.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2e9a4b5..87a080e 100644 --- a/package.json +++ b/package.json @@ -186,7 +186,7 @@ "CrossSeed": { "name": "青蛙辅种助手", "description": "参考ReseedPuppy和IYUU辅种插件实现自动辅种,支持站点:青蛙、AGSVPT、麒麟、UBits、聆音等。", - "version": "1.5", + "version": "1.6", "icon": "qingwa.png", "author": "233@qingwa", "level": 2 diff --git a/plugins/crossseed/__init__.py b/plugins/crossseed/__init__.py index 1a4bb47..215af32 100644 --- a/plugins/crossseed/__init__.py +++ b/plugins/crossseed/__init__.py @@ -36,7 +36,7 @@ class CrossSeed(_PluginBase): # 插件图标 plugin_icon = "qingwa.png" # 插件版本 - plugin_version = "1.5" + plugin_version = "1.6" # 插件作者 plugin_author = "233@qingwa" # 作者主页 diff --git a/plugins/crossseed/cross_seed_helper.py b/plugins/crossseed/cross_seed_helper.py index 82441f4..08e5bd3 100644 --- a/plugins/crossseed/cross_seed_helper.py +++ b/plugins/crossseed/cross_seed_helper.py @@ -3,7 +3,7 @@ from pathlib import Path from typing import Self import requests -from bencode import decode, encode +from bencode import bdecode, bencode class CSSiteConfig(object): @@ -60,10 +60,10 @@ class TorInfo: @staticmethod def from_data(data: bytes) -> tuple[Self, str]: try: - torrent = decode(data) + torrent = bdecode(data) info = torrent["info"] pieces = info["pieces"] - info_hash = hashlib.sha1(encode(info)).hexdigest() + info_hash = hashlib.sha1(bencode(info)).hexdigest() pieces_hash = hashlib.sha1(pieces).hexdigest() local_tor = TorInfo(info_hash=info_hash, pieces_hash=pieces_hash) #从种子中获取 announce, qb可能存在获取不到的情况,会存在于fastresume文件中