From: Roland Häder Date: Sun, 28 May 2023 14:34:57 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a068494d2b4845e41bb82066510e4e7e6a11db4c;p=fba.git Continued: - only a warning, 'activitypub-troll.cf' is to much rampant - skip to next entry in case if being blacklisted or no 'host' found --- 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