From 5145527d0ef51976c81e2da1f70d88af979be4e1 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 6 Sep 2023 08:34:04 +0800 Subject: [PATCH] fix #456 --- app/plugins/nastoolsync/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/plugins/nastoolsync/__init__.py b/app/plugins/nastoolsync/__init__.py index a66fc8cc..fd4352f7 100644 --- a/app/plugins/nastoolsync/__init__.py +++ b/app/plugins/nastoolsync/__init__.py @@ -153,7 +153,12 @@ class NAStoolSync(_PluginBase): if self._downloader: downloaders = self._downloader.split("\n") for downloader in downloaders: + if not downloader: + continue sub_downloaders = downloader.split(":") + if not str(sub_downloaders[0]).isdigit(): + logger.error(f"下载器映射配置错误:NAStool下载器id 应为数字!") + continue # 替换转种记录 if str(plugin_id) == "TorrentTransfer": keys = str(plugin_key).split("-") @@ -173,6 +178,8 @@ class NAStoolSync(_PluginBase): if isinstance(plugin_value, str): plugin_value = json.loads(plugin_value) for value in plugin_value: + if not str(value.get("downloader")).isdigit(): + continue if str(value.get("downloader")).isdigit() and int(value.get("downloader")) == int( sub_downloaders[0]): value["downloader"] = sub_downloaders[1]