mirror of
https://github.com/chubin/wttr.in.git
synced 2025-08-13 15:37:03 +02:00
Capture region from ip2location lookup
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user