nftables-geoip icon indicating copy to clipboard operation
nftables-geoip copied to clipboard

DB download does not exist due to date tick over

Open rayleroux opened this issue 4 years ago • 1 comments

"Error trying to download DB-IP lite geoip csv file. Bailing out..." when trying to download free DB as 2021-02 does not exist yet.

I've modified it to get 2021-01 but to add some resiliency to the script you could attempt the previous month on failure.

This is the line where the problem exists.

url = 'https://download.db-ip.com/free/dbip-country-lite-{}.csv.gz'.format(time.strftime("%Y-%m"))

rayleroux avatar Feb 01 '21 04:02 rayleroux

Handling this case may seem reasonable. But testing with the past month database would be useless if data is outdated, wouldn't it?. I imagine that some of the cidr do not change its geolocation data that frequently but I have no experience nor knowledge to prove so.

I agree that the script being unusable first day of the month is weird. I'll look into it (the moment I get some more free time). If no better idea comes to mind it could be patched with yours.

Thank you for reporting this :+1:

pvxe avatar Feb 02 '21 17:02 pvxe