更新 .gitea/workflows/convert_surge_to_gogost.py
All checks were successful
SurgeToGoGostConverter / convert (push) Successful in 4s

This commit is contained in:
2024-11-09 07:27:09 +00:00
parent 55d6693bb1
commit f53dd4e30c

View File

@@ -1,5 +1,4 @@
import os
import re
def convert_surge_to_gogost(input_path, output_path):
with open(input_path, 'r') as infile, open(output_path, 'w') as outfile:
@@ -56,7 +55,8 @@ os.makedirs(output_dir, exist_ok=True)
# 逐个转换指定目录中的 Surge 规则文件
for filename in os.listdir(input_dir):
if filename.endswith(".list"): # 假设规则文件以 .txt 结尾
if filename.endswith(".list"): # Surge 规则文件以 .list 结尾
input_path = os.path.join(input_dir, filename)
output_path = os.path.join(output_dir, filename)
output_filename = f"{os.path.splitext(filename)[0]}.txt" # 输出文件以 .txt 结尾
output_path = os.path.join(output_dir, output_filename)
convert_surge_to_gogost(input_path, output_path)