From 0c6274395d58d8b2a80ebe734b43b3799f8ab588 Mon Sep 17 00:00:00 2001 From: x1ao4 Date: Mon, 19 May 2025 17:02:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E6=8F=92=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/alist.py | 30 +++++++++++++++--------------- plugins/alist_strm.py | 14 +++++++------- plugins/alist_strm_gen.py | 22 +++++++++++----------- plugins/aria2.py | 10 +++++----- plugins/emby.py | 18 +++++++++--------- plugins/plex.py | 18 +++++++++--------- quark_auto_save.py | 5 +++-- 7 files changed, 59 insertions(+), 58 deletions(-) diff --git a/plugins/alist.py b/plugins/alist.py index 5721bef..5d3a306 100644 --- a/plugins/alist.py +++ b/plugins/alist.py @@ -52,13 +52,13 @@ class Alist: response = response.json() if response.get("code") == 200: print( - f"Alist刷新: {response.get('data',[])[1].get('value','')} {response.get('data',[])[0].get('value','')}" + f"AList 刷新: {response.get('data',[])[1].get('value','')} {response.get('data',[])[0].get('value','')}" ) return True else: - print(f"Alist刷新: 连接失败❌ {response.get('message')}") + print(f"AList 刷新: 连接失败 ❌ {response.get('message')}") except requests.exceptions.RequestException as e: - print(f"获取Alist信息出错: {e}") + print(f"获取 AList 信息出错: {e}") return False def storage_id_to_path(self, storage_id): @@ -69,7 +69,7 @@ class Alist: storage_mount_path, quark_root_dir = match.group(1), match.group(2) file_list = self.get_file_list(storage_mount_path) if file_list.get("code") != 200: - print(f"Alist刷新: 获取挂载路径失败❌ {file_list.get('message')}") + print(f"AList 刷新: 获取挂载路径失败 ❌ {file_list.get('message')}") return False, (None, None) # 2. 检查是否数字,调用 Alist API 获取存储信息 elif re.match(r"^\d+$", storage_id): @@ -84,12 +84,12 @@ class Alist: ) elif storage_info["driver"] == "QuarkTV": print( - f"Alist刷新: [QuarkTV]驱动⚠️ storage_id请手动填入 /Alist挂载路径:/Quark目录路径" + f"AList 刷新: [QuarkTV] 驱动 ⚠️ storage_id 请手动填入 /Alist挂载路径:/Quark目录路径" ) else: - print(f"Alist刷新: 不支持[{storage_info['driver']}]驱动 ❌") + print(f"AList 刷新: 不支持 [{storage_info['driver']}] 驱动 ❌") else: - print(f"Alist刷新: storage_id[{storage_id}]格式错误❌") + print(f"AList 刷新: storage_id [{storage_id}] 格式错误 ❌") # 返回结果 if storage_mount_path and quark_root_dir: return True, (storage_mount_path, quark_root_dir) @@ -107,28 +107,28 @@ class Alist: if data.get("code") == 200: return data.get("data", []) else: - print(f"Alist刷新: 存储{storage_id}连接失败❌ {data.get('message')}") + print(f"AList 刷新: 存储 {storage_id} 连接失败 ❌ {data.get('message')}") except Exception as e: - print(f"Alist刷新: 获取Alist存储出错 {e}") + print(f"AList 刷新: 获取 AList 存储出错 {e}") return [] def refresh(self, path): data = self.get_file_list(path, True) if data.get("code") == 200: - print(f"📁 Alist刷新:目录[{path}] 成功✅") + print(f"📁 AList 刷新: 目录 [{path}] 成功 ✅") return data.get("data") elif "object not found" in data.get("message", ""): # 如果是根目录就不再往上查找 if path == "/" or path == self.storage_mount_path: - print(f"📁 Alist刷新:根目录不存在,请检查 Alist 配置") + print(f"📁 AList 刷新: 根目录不存在,请检查 AList 配置") return False # 获取父目录 parent_path = os.path.dirname(path) - print(f"📁 Alist刷新:[{path}] 不存在,转父目录 [{parent_path}]") + print(f"📁 AList 刷新: [{path}] 不存在,转父目录 [{parent_path}]") # 递归刷新父目录 return self.refresh(parent_path) else: - print(f"📁 Alist刷新:失败❌ {data.get('message')}") + print(f"📁 AList 刷新: 失败 ❌ {data.get('message')}") def get_file_list(self, path, force_refresh=False): url = f"{self.url}/api/fs/list" @@ -145,7 +145,7 @@ class Alist: response.raise_for_status() return response.json() except Exception as e: - print(f"📁 Alist刷新: 获取文件列表出错❌ {e}") + print(f"📁 AList 刷新: 获取文件列表出错 ❌ {e}") return {} def get_root_folder_full_path(self, cookie, pdir_fid): @@ -178,5 +178,5 @@ class Alist: path = f"{path}/{item['file_name']}" return path except Exception as e: - print(f"Alist刷新: 获取Quark路径出错 {e}") + print(f"AList 刷新: 获取 Quark 路径出错 {e}") return "" diff --git a/plugins/alist_strm.py b/plugins/alist_strm.py index cb50b7d..0d7c3f3 100644 --- a/plugins/alist_strm.py +++ b/plugins/alist_strm.py @@ -2,7 +2,7 @@ import re import requests """ - 配合 alist-strm 项目,触发特定配置运行 + 配合 Alist-Strm 项目,触发特定配置运行 https://github.com/tefuirZ/alist-strm """ @@ -47,12 +47,12 @@ class Alist_strm: for item in matchs if item[0] in config_id_str.split(",") ] - print(f"alist-strm配置运行: {config_name}") + print(f"Alist-Strm 配置运行: {config_name}") return True else: - print(f"alist-strm配置运行: 匹配失败❌,请检查网络连通和cookie有效性") + print(f"Alist-Strm 配置运行: 匹配失败 ❌ 请检查网络连通和cookie有效性") except Exception as e: - print(f"获取alist-strm配置信息出错: {e}") + print(f"获取 Alist-Strm 配置信息出错: {e}") return False def run_selected_configs(self, selected_configs_str): @@ -61,7 +61,7 @@ class Alist_strm: try: selected_configs = [int(x.strip()) for x in selected_configs_str.split(",")] except ValueError: - print("🔗 alist-strm配置运行: 出错❌ id应以,分割") + print("🔗 Alist-Strm 配置运行: 出错 ❌ ID 应以 , 分割") return False data = [("selected_configs", config_id) for config_id in selected_configs] data.append(("action", "run_selected")) @@ -73,10 +73,10 @@ class Alist_strm: match = re.search(r'role="alert">\s*([^<]+)\s*