66
77uapi = "api.uapis.cn"
88uapi_old = "uapis.cn"
9- axtn = "api.axtn.net"
109
1110
1211async def get_ip_info (ip ):
13- url = f"https://{ uapi } /ipinfo?ip={ ip } "
12+ url = f"https://{ uapi } /api/v1/network/ ipinfo?ip={ ip } "
1413 async with aiohttp .ClientSession () as session :
1514 try :
1615 async with session .get (url ) as response :
@@ -21,13 +20,8 @@ async def get_ip_info(ip):
2120 return None
2221
2322
24- async def get_ping_info (ip , node ):
25- if node == "cn" :
26- url = f"https://{ uapi } /ping?host={ ip } "
27- elif node == "hk" :
28- url = f"https://{ axtn } /ping?host={ ip } "
29- else :
30- return None
23+ async def get_ping_info (ip ):
24+ url = f"https://{ uapi } /api/v1/network/ping?host={ ip } "
3125
3226 async with aiohttp .ClientSession () as session :
3327 try :
@@ -40,7 +34,7 @@ async def get_ping_info(ip, node):
4034
4135
4236async def get_whois_info (domain ):
43- url = f"https://{ uapi } /whois?domain={ domain } "
37+ url = f"https://{ uapi } /api/v1/network/ whois?domain={ domain } &format=json "
4438 async with aiohttp .ClientSession () as session :
4539 try :
4640 async with session .get (url ) as response :
@@ -52,11 +46,11 @@ async def get_whois_info(domain):
5246 except ClientError as e :
5347 logger .error (f"请求错误:{ e } " )
5448 info = await response .json ()['error' ] if "error" in response .json () else "未返回正确值"
55- return {"error" : " info" }
49+ return {"error" : info }
5650
5751
5852async def get_icp_info (domain ):
59- url = f"https://{ uapi_old } /api/icp?domain={ domain } "
53+ url = f"https://{ uapi } /api/v1/network /icp?domain={ domain } "
6054 async with aiohttp .ClientSession () as session :
6155 try :
6256 async with session .get (url ) as response :
@@ -68,7 +62,7 @@ async def get_icp_info(domain):
6862
6963
7064async def get_hot_list (hot_type ):
71- url = f"https://{ uapi_old } /api/hotlist ?type={ hot_type } "
65+ url = f"https://{ uapi } /api/v1/misc/hotboard ?type={ hot_type } "
7266 async with aiohttp .ClientSession () as session :
7367 try :
7468 async with session .get (url ) as response :
@@ -92,35 +86,34 @@ async def get_answer_book():
9286
9387
9488async def get_touch_url (qqid ):
95- url = f"https://{ uapi_old } /api/mt ?qq={ str (qqid )} "
89+ url = f"https://{ uapi } /api/v1/image/motou ?qq={ str (qqid )} "
9690 return url
9791
9892
9993async def get_steamid_info (steamid ):
10094 split_str = steamid .split (" " )
10195 steamid = split_str [1 ] # 获取分割后的第二个子字符串
102- url = f"https://{ uapi_old } /api/steamuserinfo?input ={ steamid } "
96+ url = f"https://{ uapi } /api/v1/game/steam/summary?steamid ={ steamid } "
10397 async with aiohttp .ClientSession () as session :
10498 try :
10599 async with session .get (url ) as response :
106100 if response .status == 200 :
107101 data = await response .json ()
108102 if data .get ("code" ) == 200 :
109- communitystate = data .get ("communitystate " ) if data .get ("communitystate " ) != 'N/A' else "未知"
110- steamID64 = data .get ("steamID64 " ) if data .get ("steamID64 " ) != 'N/A' else "未知"
111- steamUsername = data .get ("username " ) if data .get ("username " ) != 'N/A' else "未知"
103+ communitystate = data .get ("communityvisibilitystate " ) if data .get ("communityvisibilitystate " ) != 'N/A' else "未知"
104+ steamID64 = data .get ("steamid " ) if data .get ("steamid " ) != 'N/A' else "未知"
105+ steamUsername = data .get ("personaname " ) if data .get ("personaname " ) != 'N/A' else "未知"
112106 realname = data .get ("realname" ) if data .get ("realname" ) != 'N/A' else "未知"
113- accountcreationdate = data .get ("accountcreationdate " ) if data .get ("accountcreationdate " ) != 'N/A' else "未知"
114- lastlogoff = data .get ("lastlogoff" ) if data .get ("lastlogoff" ) != '1970-01-01 08:00:00' and data .get ("lastlogoff" ) != 'N/A' else "未知"
115- location = data .get ("location " ) if data .get ("location " ) != 'N/A' else "未知"
107+ accountcreationdate = data .get ("timecreated_str " ) if data .get ("timecreated_str " ) != 'N/A' else "未知"
108+ # lastlogoff = data.get("lastlogoff") if data.get("lastlogoff") != '1970-01-01 08:00:00' and data.get("lastlogoff") != 'N/A' else "未知"
109+ location = data .get ("loccountrycode " ) if data .get ("loccountrycode " ) != 'N/A' else "未知"
116110 return f"""
117111====Steam账户信息====
118112| 社区资料状态:{ communitystate }
119113| 用户名:{ steamUsername }
120114| 真实姓名:{ realname }
121115| Steam ID:{ steamID64 }
122116| 账户创建日期:{ accountcreationdate }
123- | 最后下线日期:{ lastlogoff }
124117| 地理位置:{ location }
125118=====================
126119"""
@@ -161,12 +154,12 @@ def translate_domain_status(status_list):
161154
162155
163156def format_hot_search (data ):
164- items = data .get ("data " , [])[:10 ]
157+ items = data .get ("list " , [])[:10 ]
165158 formatted = []
166159 for item in items :
167160 index = item .get ("index" , "" )
168161 title = item .get ("title" , "" )
169- hot = item .get ("hot " , None )
162+ hot = item .get ("hot_value " , None )
170163 if hot :
171164 formatted .append (f"{ index } - { title } | { hot } " )
172165 else :
0 commit comments