This commit is contained in:
yumoqing 2022-05-09 18:00:16 +08:00
parent ed5976fe6b
commit 14ddc35f52
2 changed files with 9 additions and 1 deletions

View File

@ -24,6 +24,13 @@ def ipip(ip=None):
'city':r[2] 'city':r[2]
} }
def ip_api_com(ip):
url = f'http://ip-api.com/json/{ip}'
hc = Http_Client()
r = hc.get(url)
r['City'] = r['city']
return r
def iplocation(ip=None): def iplocation(ip=None):
if ip is None: if ip is None:
ip = get_outip() ip = get_outip()
@ -71,6 +78,7 @@ def ipaddress_com(ip=None):
def get_ip_location(ip): def get_ip_location(ip):
apis = { apis = {
"ip-api":ip_api_com,
"ipaddress":ipaddress_com, "ipaddress":ipaddress_com,
"ipip.net":ipip, "ipip.net":ipip,
"iplocation":iplocation, "iplocation":iplocation,

View File

@ -11,7 +11,7 @@ except ImportError:
# python setup.py bdist_egg generate a egg file # python setup.py bdist_egg generate a egg file
# Release information about eway # Release information about eway
version = "5.1.5" version = "5.1.6"
name = "appPublic" name = "appPublic"
description = "appPublic" description = "appPublic"
author = "yumoqing" author = "yumoqing"