some IP's have no information about the provider or asn

This commit is contained in:
jenz 2022-04-10 16:01:19 +02:00
parent 595bb74543
commit dfe0323283

View File

@ -21,9 +21,13 @@ def main():
jrequest = requests.get(url).json()
#print(jrequest)
d = jrequest[ip]
try:
asn = d["asn"]
provider = d["provider"]
country = d["country"]
except Exception:
print(f'failed: {jrequest}')
continue
with get_connection() as conn:
with conn.cursor() as cur:
sql_statement = """