mirror of
https://github.com/Toperlock/sing-box-geosite.git
synced 2025-06-08 09:42:14 +08:00
Update main.py
This commit is contained in:
parent
48e5ecb2fa
commit
599c54fe18
2
main.py
2
main.py
@ -116,7 +116,7 @@ def parse_list_file(link, output_directory):
|
|||||||
# 使用 output_directory 拼接完整路径
|
# 使用 output_directory 拼接完整路径
|
||||||
file_name = os.path.join(output_directory, f"{os.path.basename(link).split('.')[0]}.json")
|
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:
|
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")
|
srs_path = file_name.replace(".json", ".srs")
|
||||||
os.system(f"sing-box rule-set compile --output {srs_path} {file_name}")
|
os.system(f"sing-box rule-set compile --output {srs_path} {file_name}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user