Update geo ip misc plugin
This commit is contained in:
parent
9db72f41fd
commit
e2210f3eab
|
@ -24,7 +24,7 @@ import json
|
||||||
|
|
||||||
def geoiplookup(ip):
|
def geoiplookup(ip):
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
r = http.request('GET', f'https://api.geoiplookup.net/?query={ip}&json=true')
|
r = http.request('GET', f'http://ip-api.com/json/{ip}')
|
||||||
|
|
||||||
if r.status != 200:
|
if r.status != 200:
|
||||||
raise Exception(r)
|
raise Exception(r)
|
||||||
|
|
|
@ -85,8 +85,8 @@ class IWLADisplayFilterUsers(IPlugin):
|
||||||
isp = location.get('isp', '')
|
isp = location.get('isp', '')
|
||||||
str_location = ''
|
str_location = ''
|
||||||
city = location.get('city', unknown)
|
city = location.get('city', unknown)
|
||||||
country = location.get('countryname', unknown)
|
country = location.get('country', unknown)
|
||||||
if location.get('city', '') or location.get('countryname'):
|
if location.get('city', '') or location.get('country', ''):
|
||||||
str_location = f'{city}/{country}'
|
str_location = f'{city}/{country}'
|
||||||
if isp:
|
if isp:
|
||||||
if str_location: str_location += '<br/>'
|
if str_location: str_location += '<br/>'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user