Update geo ip misc plugin

This commit is contained in:
Gregory Soutade 2024-02-15 10:55:59 +01:00
parent 9db72f41fd
commit e2210f3eab
2 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ import json
def geoiplookup(ip):
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:
raise Exception(r)

View File

@ -85,8 +85,8 @@ class IWLADisplayFilterUsers(IPlugin):
isp = location.get('isp', '')
str_location = ''
city = location.get('city', unknown)
country = location.get('countryname', unknown)
if location.get('city', '') or location.get('countryname'):
country = location.get('country', unknown)
if location.get('city', '') or location.get('country', ''):
str_location = f'{city}/{country}'
if isp:
if str_location: str_location += '<br/>'