From dfe0323283b3b759aa88e61cb1c5a602d76b55fa Mon Sep 17 00:00:00 2001 From: jenz Date: Sun, 10 Apr 2022 16:01:19 +0200 Subject: [PATCH] some IP's have no information about the provider or asn --- nosteam_verificiation/python/update_sb.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nosteam_verificiation/python/update_sb.py b/nosteam_verificiation/python/update_sb.py index 2a719a1c..a5c082a9 100644 --- a/nosteam_verificiation/python/update_sb.py +++ b/nosteam_verificiation/python/update_sb.py @@ -21,9 +21,13 @@ def main(): jrequest = requests.get(url).json() #print(jrequest) d = jrequest[ip] - asn = d["asn"] - provider = d["provider"] - country = d["country"] + 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 = """