some IP's have no information about the provider or asn
This commit is contained in:
parent
595bb74543
commit
dfe0323283
@ -21,9 +21,13 @@ def main():
|
|||||||
jrequest = requests.get(url).json()
|
jrequest = requests.get(url).json()
|
||||||
#print(jrequest)
|
#print(jrequest)
|
||||||
d = jrequest[ip]
|
d = jrequest[ip]
|
||||||
|
try:
|
||||||
asn = d["asn"]
|
asn = d["asn"]
|
||||||
provider = d["provider"]
|
provider = d["provider"]
|
||||||
country = d["country"]
|
country = d["country"]
|
||||||
|
except Exception:
|
||||||
|
print(f'failed: {jrequest}')
|
||||||
|
continue
|
||||||
with get_connection() as conn:
|
with get_connection() as conn:
|
||||||
with conn.cursor() as cur:
|
with conn.cursor() as cur:
|
||||||
sql_statement = """
|
sql_statement = """
|
||||||
|
Loading…
Reference in New Issue
Block a user