update:合并最新代码

This commit is contained in:
hrz
2025-04-04 00:27:04 +08:00
parent c8a3d378b7
commit 0b4a4df1af
42 changed files with 4559 additions and 532 deletions
+2 -6
View File
@@ -67,15 +67,11 @@ def is_private_ip(ip_addr):
def get_ip_info(ip_addr):
try:
base_url = "https://freeipapi.com/api/json"
url = base_url if is_private_ip(ip_addr) else f"{base_url}/{ip_addr}"
url = "https://whois.pconline.com.cn/ipJson.jsp?json=true"
resp = requests.get(url).json()
ip_info = {
"city": resp.get("cityName"),
"region": resp.get("regionName"),
"country": resp.get("countryName")
"city": resp.get("city")
}
return ip_info
except Exception as e: