From 925144ea79d2ca8d16455f1bc81bfd6dc9046f3a Mon Sep 17 00:00:00 2001 From: Cp0204 Date: Wed, 27 Nov 2024 19:07:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=8C=82=E8=BD=BD=E8=B7=AF=E5=BE=84=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在获取文件列表时添加错误检查 - 如果获取失败,打印错误信息以便调试 --- plugins/alist.py | 4 +++- plugins/alist_strm_gen.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/alist.py b/plugins/alist.py index c974207..9433cfc 100644 --- a/plugins/alist.py +++ b/plugins/alist.py @@ -67,7 +67,9 @@ class Alist: if match := re.match(r"^(\/[^:]*):(\/[^:]*)$", storage_id): # 存储挂载路径, 夸克根文件夹 storage_mount_path, quark_root_dir = match.group(1), match.group(2) - if not self.get_file_list(storage_mount_path): + file_list = self.get_file_list(storage_mount_path) + if file_list.get("code") != 200: + print(f"Alist刷新: 获取挂载路径失败❌ {file_list.get('message')}") return False, (None, None) # 2. 检查是否数字,调用 Alist API 获取存储信息 elif re.match(r"^\d+$", storage_id): diff --git a/plugins/alist_strm_gen.py b/plugins/alist_strm_gen.py index 0363fbc..28f17a1 100644 --- a/plugins/alist_strm_gen.py +++ b/plugins/alist_strm_gen.py @@ -80,7 +80,9 @@ class Alist_strm_gen: if match := re.match(r"^(\/[^:]*):(\/[^:]*)$", storage_id): # 存储挂载路径, 夸克根文件夹 storage_mount_path, quark_root_dir = match.group(1), match.group(2) - if not self.get_file_list(storage_mount_path): + file_list = self.get_file_list(storage_mount_path) + if file_list.get("code") != 200: + print(f"Alist-Strm生成: 获取挂载路径失败❌ {file_list.get('message')}") return False, (None, None) # 2. 检查是否数字,调用 Alist API 获取存储信息 elif re.match(r"^\d+$", storage_id):