use db-ip mmdb

This commit is contained in:
j 2020-02-02 15:31:32 +01:00
parent 66f9a51769
commit 6b82d7bbf7
1 changed files with 2 additions and 1 deletions

View File

@ -397,8 +397,9 @@ def update_geoip(force=False):
path = os.path.join(settings.GEOIP_PATH, 'GeoLite2-City.mmdb')
if not os.path.exists(path) or force:
url = 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz'
url = 'https://download.db-ip.com/free/dbip-city-lite-2020-01.mmdb.gz'
print('download', url)
ox.net.save_url(url, "%s.gz"%path)
ox.net.save_url(url, "%s.gz" % path)
if os.path.exists(path):
os.unlink(path)
os.system('gunzip "%s.gz"' % path)