fix wallpaper
This commit is contained in:
@@ -172,39 +172,3 @@ class RequestUtils:
|
||||
cookiesList.append(cookies)
|
||||
return cookiesList
|
||||
return cookie_dict
|
||||
|
||||
|
||||
class WebUtils:
|
||||
@staticmethod
|
||||
def get_location(ip: str):
|
||||
"""
|
||||
https://api.mir6.com/api/ip
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "success",
|
||||
"data": {
|
||||
"ip": "240e:97c:2f:1::5c",
|
||||
"dec": "47925092370311863177116789888333643868",
|
||||
"country": "中国",
|
||||
"countryCode": "CN",
|
||||
"province": "广东省",
|
||||
"city": "广州市",
|
||||
"districts": "",
|
||||
"idc": "",
|
||||
"isp": "中国电信",
|
||||
"net": "数据中心",
|
||||
"zipcode": "510000",
|
||||
"areacode": "020",
|
||||
"protocol": "IPv6",
|
||||
"location": "中国[CN] 广东省 广州市",
|
||||
"myip": "125.89.7.89",
|
||||
"time": "2023-09-01 17:28:23"
|
||||
}
|
||||
}
|
||||
"""
|
||||
try:
|
||||
r = RequestUtils().get_res(f"https://api.mir6.com/api/ip?ip={ip}&type=json")
|
||||
if r:
|
||||
return r.json().get("data", {}).get("location") or ''
|
||||
except Exception as err:
|
||||
return str(err)
|
||||
|
Reference in New Issue
Block a user