mirror of
https://github.com/Toperlock/sing-box-geosite.git
synced 2025-06-08 09:42:14 +08:00
add error message
This commit is contained in:
parent
b1e18acfdf
commit
2210c74621
4
main.py
4
main.py
@ -110,6 +110,7 @@ def sort_dict(obj):
|
|||||||
return obj
|
return obj
|
||||||
|
|
||||||
def parse_list_file(link, output_directory):
|
def parse_list_file(link, output_directory):
|
||||||
|
try:
|
||||||
with concurrent.futures.ThreadPoolExecutor() as executor:
|
with concurrent.futures.ThreadPoolExecutor() as executor:
|
||||||
results= list(executor.map(parse_and_convert_to_dataframe, [link])) # 使用executor.map并行处理链接, 得到(df, rules)元组的列表
|
results= list(executor.map(parse_and_convert_to_dataframe, [link])) # 使用executor.map并行处理链接, 得到(df, rules)元组的列表
|
||||||
dfs = [df for df, rules in results] # 提取df的内容
|
dfs = [df for df, rules in results] # 提取df的内容
|
||||||
@ -154,6 +155,9 @@ def parse_list_file(link, output_directory):
|
|||||||
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}")
|
||||||
return file_name
|
return file_name
|
||||||
|
except:
|
||||||
|
print(f'获取链接出错,已跳过:{link}')
|
||||||
|
pass
|
||||||
|
|
||||||
# 读取 links.txt 中的每个链接并生成对应的 JSON 文件
|
# 读取 links.txt 中的每个链接并生成对应的 JSON 文件
|
||||||
with open("../links.txt", 'r') as links_file:
|
with open("../links.txt", 'r') as links_file:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user