diff --git a/package.json b/package.json index e065eb4..1391037 100644 --- a/package.json +++ b/package.json @@ -327,11 +327,12 @@ "name": "IYUU自动辅种", "description": "基于IYUU官方Api实现自动辅种。", "labels": "做种,IYUU", - "version": "1.9.13", + "version": "1.9.14", "icon": "IYUU.png", "author": "jxxghp", "level": 2, "history": { + "v1.9.14": "修复由于站点哈希值过期导致辅种失败的问题,并优化代码逻辑", "v1.9.13": "限制辅种缓存大小并重置运行期校验队列,避免长期运行缓存无限增长", "v1.9.12": "修复海豹不能辅种的问题", "v1.9.11": "修复馒头不能辅种的问题", diff --git a/package.v2.json b/package.v2.json index b2c1b0b..c95b604 100644 --- a/package.v2.json +++ b/package.v2.json @@ -273,11 +273,12 @@ "name": "IYUU自动辅种", "description": "基于IYUU官方Api实现自动辅种。", "labels": "做种,IYUU", - "version": "2.16", + "version": "2.17", "icon": "IYUU.png", "author": "jxxghp,CKun", "level": 2, "history": { + "v2.17": "修复由于站点哈希值过期导致辅种失败的问题,并优化代码逻辑", "v2.16": "限制辅种缓存大小并重置运行期校验队列,避免长期运行缓存无限增长", "v2.15": "修复海豹不能辅种的问题", "v2.14": "修复馒头不能辅种的问题", diff --git a/plugins.v2/iyuuautoseed/__init__.py b/plugins.v2/iyuuautoseed/__init__.py index 6b26ef0..be20e68 100644 --- a/plugins.v2/iyuuautoseed/__init__.py +++ b/plugins.v2/iyuuautoseed/__init__.py @@ -34,7 +34,7 @@ class IYUUAutoSeed(_PluginBase): # 插件图标 plugin_icon = "IYUU.png" # 插件版本 - plugin_version = "2.16" + plugin_version = "2.17" # 插件作者 plugin_author = "jxxghp,CKun" # 作者主页 diff --git a/plugins.v2/iyuuautoseed/iyuu_helper.py b/plugins.v2/iyuuautoseed/iyuu_helper.py index d322385..6c1b4eb 100644 --- a/plugins.v2/iyuuautoseed/iyuu_helper.py +++ b/plugins.v2/iyuuautoseed/iyuu_helper.py @@ -90,6 +90,15 @@ class IyuuHelper(object): return result.get('sid_sha1') return None + def __reseed_index(self, json_data: str, sha1: str) -> Tuple[Optional[dict], str]: + return self.__request_iyuu(url='/reseed/index/index', method='post', params={ + 'hash': json_data, + 'sha1': sha1, + 'sid_sha1': self._sid_sha1, + 'timestamp': int(time.time()), + 'version': self._version + }) + def get_seed_info(self, info_hashs: list) -> Tuple[Optional[dict], str]: """ 返回info_hash对应的站点id、种子id @@ -101,13 +110,10 @@ class IyuuHelper(object): info_hashs.sort() json_data = json.dumps(info_hashs, separators=(',', ':'), ensure_ascii=False) sha1 = self.get_sha1(json_data) - result, msg = self.__request_iyuu(url='/reseed/index/index', method='post', params={ - 'hash': json_data, - 'sha1': sha1, - 'sid_sha1': self._sid_sha1, - 'timestamp': int(time.time()), - 'version': self._version - }) + result, msg = self.__reseed_index(json_data, sha1) + if msg and "站点哈希值 require" in msg: + self._sid_sha1 = self.__report_existing() + result, msg = self.__reseed_index(json_data, sha1) return result, msg @staticmethod diff --git a/plugins/iyuuautoseed/__init__.py b/plugins/iyuuautoseed/__init__.py index 42affba..45534de 100644 --- a/plugins/iyuuautoseed/__init__.py +++ b/plugins/iyuuautoseed/__init__.py @@ -35,7 +35,7 @@ class IYUUAutoSeed(_PluginBase): # 插件图标 plugin_icon = "IYUU.png" # 插件版本 - plugin_version = "1.9.13" + plugin_version = "1.9.14" # 插件作者 plugin_author = "jxxghp" # 作者主页 diff --git a/plugins/iyuuautoseed/iyuu_helper.py b/plugins/iyuuautoseed/iyuu_helper.py index d322385..6c1b4eb 100644 --- a/plugins/iyuuautoseed/iyuu_helper.py +++ b/plugins/iyuuautoseed/iyuu_helper.py @@ -90,6 +90,15 @@ class IyuuHelper(object): return result.get('sid_sha1') return None + def __reseed_index(self, json_data: str, sha1: str) -> Tuple[Optional[dict], str]: + return self.__request_iyuu(url='/reseed/index/index', method='post', params={ + 'hash': json_data, + 'sha1': sha1, + 'sid_sha1': self._sid_sha1, + 'timestamp': int(time.time()), + 'version': self._version + }) + def get_seed_info(self, info_hashs: list) -> Tuple[Optional[dict], str]: """ 返回info_hash对应的站点id、种子id @@ -101,13 +110,10 @@ class IyuuHelper(object): info_hashs.sort() json_data = json.dumps(info_hashs, separators=(',', ':'), ensure_ascii=False) sha1 = self.get_sha1(json_data) - result, msg = self.__request_iyuu(url='/reseed/index/index', method='post', params={ - 'hash': json_data, - 'sha1': sha1, - 'sid_sha1': self._sid_sha1, - 'timestamp': int(time.time()), - 'version': self._version - }) + result, msg = self.__reseed_index(json_data, sha1) + if msg and "站点哈希值 require" in msg: + self._sid_sha1 = self.__report_existing() + result, msg = self.__reseed_index(json_data, sha1) return result, msg @staticmethod