add error message

This commit is contained in:
Dorae 2024-06-26 22:41:36 +08:00 committed by GitHub
parent b1e18acfdf
commit 2210c74621
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: