Filter cache entries affected by #576

This commit is contained in:
Igor Chubin 2021-02-27 16:55:53 +01:00
parent 2141bdb944
commit f067e82956

View file

@ -468,9 +468,14 @@ def _main_():
for filename in glob.glob(os.path.join(IP2LCACHE, "*")): for filename in glob.glob(os.path.join(IP2LCACHE, "*")):
ip_address = os.path.basename(filename) ip_address = os.path.basename(filename)
if not _ipcache(ip_address): data = _ipcache(ip_address)
shutil.move(filename, os.path.join("/wttr.in/cache/ip2l-broken", ip_address)) if data:
city, region, country = data
if any(x in city for x in "0123456789"):
print(city)
shutil.move(filename, os.path.join("/wttr.in/cache/ip2l-broken-format", ip_address))
if __name__ == "__main__": if __name__ == "__main__":
print(_geoip("173.216.90.56")) _main_()
#print(_geoip("173.216.90.56"))