mirror of
https://github.com/chubin/wttr.in.git
synced 2025-08-14 15:58:27 +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:
|
if location and ';' in location:
|
||||||
ipcachewrite(ip_addr, location)
|
ipcachewrite(ip_addr, location)
|
||||||
location = location.split(';')[3], location.split(';')[1]
|
_, country, region, city = location.split(';')
|
||||||
|
location = city, region, country
|
||||||
else:
|
else:
|
||||||
location = location, None
|
location = location, None, None
|
||||||
|
|
||||||
return location
|
return location
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user