Spaces:
Paused
Paused
Upload 23 files
Browse files- app/sub_manager.py +5 -14
app/sub_manager.py
CHANGED
|
@@ -123,24 +123,15 @@ class SubscriptionManager:
|
|
| 123 |
data_dir = os.path.dirname(self.config_path)
|
| 124 |
os.makedirs(data_dir, exist_ok=True)
|
| 125 |
|
| 126 |
-
# 准备subconverter命令 -
|
| 127 |
-
# 将 Windows 路径转换为 file:// URI (如果需要)
|
| 128 |
-
# Python on Linux should handle /path/to/file directly
|
| 129 |
-
input_uri = input_file
|
| 130 |
-
if os.name == 'nt': # 如果在 Windows 上运行 (理论上我们是在 Linux 容器)
|
| 131 |
-
input_uri = 'file:///' + input_file.replace('\\', '/')
|
| 132 |
-
|
| 133 |
cmd = [
|
| 134 |
self.subconverter_path,
|
| 135 |
-
|
| 136 |
-
#"-o", self.config_path, # 之前的尝试
|
| 137 |
-
"-g", # 明确表示生成模式
|
| 138 |
-
"--url", input_uri, # 使用文件 URI 作为输入
|
| 139 |
"-o", self.config_path, # 输出文件
|
| 140 |
"-t", "clash" # 目标格式
|
| 141 |
-
#
|
| 142 |
-
#
|
| 143 |
-
#
|
| 144 |
]
|
| 145 |
|
| 146 |
logger.info(f"执行命令: {' '.join(cmd)}")
|
|
|
|
| 123 |
data_dir = os.path.dirname(self.config_path)
|
| 124 |
os.makedirs(data_dir, exist_ok=True)
|
| 125 |
|
| 126 |
+
# 准备subconverter命令 - 回退到使用 -i 和 -o
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
cmd = [
|
| 128 |
self.subconverter_path,
|
| 129 |
+
"-i", input_file, # 输入文件
|
|
|
|
|
|
|
|
|
|
| 130 |
"-o", self.config_path, # 输出文件
|
| 131 |
"-t", "clash" # 目标格式
|
| 132 |
+
# 移除 -g 和 --url
|
| 133 |
+
#"-g", # 明确表示生成模式
|
| 134 |
+
#"--url", input_uri, # 使用文件 URI 作为输入
|
| 135 |
]
|
| 136 |
|
| 137 |
logger.info(f"执行命令: {' '.join(cmd)}")
|