clash-linux commited on
Commit
316b06b
·
verified ·
1 Parent(s): 7fe72e6

Upload 23 files

Browse files
Files changed (1) hide show
  1. 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命令 - 尝试使用 file:// URI
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
- #"-i", input_file, # 之前的尝试
136
- #"-o", self.config_path, # 之前的尝试
137
- "-g", # 明确表示生成模式
138
- "--url", input_uri, # 使用文件 URI 作为输入
139
  "-o", self.config_path, # 输出文件
140
  "-t", "clash" # 目标格式
141
- # 添加 --config 参数指向基础配置,可能有助于避免服务器模式
142
- # 需要一个基础配置文件,例如 subconverter/base/clash.yaml
143
- # "--config", os.path.join(os.path.dirname(self.subconverter_path), "subconverter/base/clash.yaml")
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)}")