We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4be79f4 commit b4719a6Copy full SHA for b4719a6
geoip/database-updater.py
@@ -85,6 +85,12 @@ def update_ipproxy_db(outdir):
85
f"Failed to update IP2Proxy database: {url}. Status_code={resp.status_code}"
86
)
87
88
+ # IP2Location returns a 200 with "NO PERMISSION" as the body on a failure
89
+ if len(resp.content) < 1024 and b"NO PERMISSION" in resp.content:
90
+ raise RuntimeError(
91
+ "Permission denied fetching updated IP2Proxy database. IP2LOCATION_TOKEN is likely expired/bad."
92
+ )
93
+
94
with zipfile.ZipFile(io.BytesIO(resp.content), mode="r") as myzip:
95
for member in myzip.infolist():
96
if member.filename.lower().endswith(".bin"):
0 commit comments