Capture region from ip2location lookup

This commit is contained in:
Gregory Danielson
2020-11-01 13:40:20 -06:00
parent af9658f63b
commit 35a35a56e2

View File

@ -133,9 +133,10 @@ def ip2location(ip_addr):
if location and ';' in location:
ipcachewrite(ip_addr, location)
location = location.split(';')[3], location.split(';')[1]
_, country, region, city = location.split(';')
location = city, region, country
else:
location = location, None
location = location, None, None
return location