Update main.py

This commit is contained in:
Dorae 2024-01-02 10:12:48 +08:00 committed by GitHub
parent 48e5ecb2fa
commit 599c54fe18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -116,7 +116,7 @@ def parse_list_file(link, output_directory):
# 使用 output_directory 拼接完整路径
file_name = os.path.join(output_directory, f"{os.path.basename(link).split('.')[0]}.json")
with open(file_name, 'w', encoding='utf-8') as output_file:
json.dump(result_rules, output_file, ensure_ascii=False, indent=2)
json.dump(sort_dict(result_rules), output_file, ensure_ascii=False, indent=2)
srs_path = file_name.replace(".json", ".srs")
os.system(f"sing-box rule-set compile --output {srs_path} {file_name}")