From c3e3bbf0b9b480bbf2fbfac02be67cd4039e7955 Mon Sep 17 00:00:00 2001 From: Johnshall Date: Sun, 5 Dec 2021 14:24:19 +0800 Subject: [PATCH] Update the CND to top500.py --- factory/top500.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/factory/top500.py b/factory/top500.py index 1cecf56..093e44a 100644 --- a/factory/top500.py +++ b/factory/top500.py @@ -141,7 +141,9 @@ file_direct.write('# top500 direct list update time: ' + now_time + '\n') # 将苹果IP加入直连 -r = requests.get(url="https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf", headers=requests_header) +# 由于本脚本应当运行在内部环境中,可能无法访问Github,故改用staticdn.net提供的CDN节点 +# r = requests.get(url="https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/apple.china.conf", headers=requests_header) +r = requests.get(url='https://raw.staticdn.net/felixonmars/dnsmasq-china-list/master/apple.china.conf', headers=requests_header) for url in r.text.split("\n")[:-1]: url = re.sub(r'(server=\/)', '', url) # 清除前缀 url = re.sub(r'(/114.114.114.114)', '', url) # 清除后缀