From a068494d2b4845e41bb82066510e4e7e6a11db4c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 28 May 2023 16:34:57 +0200 Subject: [PATCH] Continued: - only a warning, 'activitypub-troll.cf' is to much rampant - skip to next entry in case if being blacklisted or no 'host' found --- fba.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fba.py b/fba.py index f922580..e4dbe91 100644 --- a/fba.py +++ b/fba.py @@ -389,13 +389,15 @@ def get_peers(domain: str, software: str) -> list: # Check records for row in fetched: # DEBUG: print(f"DEBUG: row():{len(row)}") - if "host" in row and is_blacklisted(row["host"]): - print(f"WARNING: row[host]='{row['host']}' is blacklisted. domain='{domain}'") - elif "host" in row: - # DEBUG: print(f"DEBUG: Adding peer: '{row['host']}'") - peers.append(row["host"]) - else: + if not "host" in row: print(f"WARNING: row()={len(row)} does not contain element 'host': {row},domain='{domain}'") + continue + elif "host" in row and is_blacklisted(row["host"]): + # DEBUG: print(f"DEBUG: row[host]='{row['host']}' is blacklisted. domain='{domain}'") + continue + + # DEBUG: print(f"DEBUG: Adding peer: '{row['host']}'") + peers.append(row["host"]) # DEBUG: print("DEBUG: Returning peers[]:", type(peers)) return peers -- 2.39.5