Capture region from ip2location lookup

gregdan3/master
Gregory Danielson 4 years ago
parent af9658f63b
commit 35a35a56e2
No known key found for this signature in database
GPG Key ID: 88D4EF22F6C14CA7

@ -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

Loading…
Cancel
Save