From 14ddc35f529f229c8348480ce86929a50d34e9bb Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 9 May 2022 18:00:16 +0800 Subject: [PATCH] bugfix --- appPublic/iplocation.py | 8 ++++++++ setup.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/appPublic/iplocation.py b/appPublic/iplocation.py index b9742f9..5b69dfa 100644 --- a/appPublic/iplocation.py +++ b/appPublic/iplocation.py @@ -24,6 +24,13 @@ def ipip(ip=None): '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): if ip is None: ip = get_outip() @@ -71,6 +78,7 @@ def ipaddress_com(ip=None): def get_ip_location(ip): apis = { + "ip-api":ip_api_com, "ipaddress":ipaddress_com, "ipip.net":ipip, "iplocation":iplocation, diff --git a/setup.py b/setup.py index 168fafe..dc22193 100755 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ except ImportError: # python setup.py bdist_egg generate a egg file # Release information about eway -version = "5.1.5" +version = "5.1.6" name = "appPublic" description = "appPublic" author = "yumoqing"