From 599c54fe18023dd65e06cee1028cc31ca2eee010 Mon Sep 17 00:00:00 2001 From: Dorae <86833913+Toperlock@users.noreply.github.com> Date: Tue, 2 Jan 2024 10:12:48 +0800 Subject: [PATCH] Update main.py --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 42058633c..88f46af90 100644 --- a/main.py +++ b/main.py @@ -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}")