Qilan2 commited on
Commit
b0ba73a
·
verified ·
1 Parent(s): edecdb7

Update server2.py

Browse files
Files changed (1) hide show
  1. server2.py +2 -2
server2.py CHANGED
@@ -430,8 +430,8 @@ def replace_ip_and_country_in_file(file_path):
430
  # print(f"读取到的文件内容: {content}")
431
 
432
  # 使用正则表达式匹配 "IP[xxx]国家[yyy]" 的格式
433
- pattern = r'IP\[.*?\]国家\[.*?\]'
434
- replacement = f'机子IP[{geo_info["ip"]}]国家[{geo_info["country"]}] ISP[{geo_info["isp"]}]'
435
  new_content = re.sub(pattern, replacement, content)
436
 
437
  # print(f"替换后的内容: {new_content}")
 
430
  # print(f"读取到的文件内容: {content}")
431
 
432
  # 使用正则表达式匹配 "IP[xxx]国家[yyy]" 的格式
433
+ pattern = r'IP\[.*?\]国家\[.*?\]ISP\[.*?\]'
434
+ replacement = f'机子IP[{geo_info["ip"]}]国家[{geo_info["country"]}]ISP[{geo_info["isp"]}]'
435
  new_content = re.sub(pattern, replacement, content)
436
 
437
  # print(f"替换后的内容: {new_content}")