Add location[2] to ipcachewrite for new region part of cache

This commit is contained in:
Gregory Danielson 2020-11-01 15:03:14 -06:00
parent 08be8787b1
commit 4fa1ebd995
No known key found for this signature in database
GPG key ID: 88D4EF22F6C14CA7

View file

@ -94,7 +94,8 @@ def ipcachewrite(ip_addr, location):
if not os.path.exists(IP2LCACHE):
os.makedirs(IP2LCACHE)
with open(cached, 'w') as file:
file.write(location[0] + ';' + location[1])
file.write(location[0] + ';' + location[1] + ';' + location[2])
# like ip2location format, but reversed
def ipcache(ip_addr):
cached = os.path.join(IP2LCACHE, ip_addr)