Gcore CDN 优选 IP(获取指定延迟范围的IP)
Gcore CDN 优选 IP(获取指定延迟范围的IP) Gcore CDN 官方 IP 列表: https://api.gcorelabs.com/cdn/public-ip-list import requests as rs; import ipaddress as ip from ping3 import ping as ping def getGcoreIPList(): src = 'https://api.gcorelabs.com/cdn/public-ip-list' resp = rs.get(src) if resp.status_code == 200: data = resp.json() IPList = data['addresses'] return IPList def traceIp(IPList): saveIplist = '.\\iplist.txt' with open(saveIplist, 'w') as filewriteIp: for cidrip in IPList: net = ip.ip_network(cidrip) for ....