From: Roland Häder Date: Sun, 11 Jun 2023 19:24:48 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=551fe19da28d59b8e188bac72d1652fedbde522c;p=fba.git Continued: - some Mastodon API responses have no comment in it --- diff --git a/fba/networks/mastodon.py b/fba/networks/mastodon.py index 37cff01..760e5e6 100644 --- a/fba/networks/mastodon.py +++ b/fba/networks/mastodon.py @@ -193,7 +193,7 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str): entry = { "domain": block["domain"], "hash" : block["digest"], - "reason": block["comment"] + "reason": block["comment"] if "comment" in block else None } # DEBUG: print("DEBUG: severity,domain,hash,comment:", block['severity'], block['domain'], block['digest'], block['comment']) diff --git a/fba/networks/peertube.py b/fba/networks/peertube.py index a493139..f8813d1 100644 --- a/fba/networks/peertube.py +++ b/fba/networks/peertube.py @@ -64,7 +64,7 @@ def fetch_peers(domain: str) -> list: print(f"WARNING: record from '{domain}' has no '{mode}' or 'host' record: {record}") if len(data["json"]["data"]) < 100: - print("DEBUG: Reached end of JSON response:", domain) + print(f"DEBUG: Reached end of JSON response, domain='{domain}'") break # Continue with next row @@ -76,5 +76,5 @@ def fetch_peers(domain: str) -> list: print(f"DEBUG: Updating last_instance_fetch for domain='{domain}' ...") instances.update_last_instance_fetch(domain) - print("DEBUG: Returning peers[]:", type(peers)) + print(f"DEBUG: Returning peers[]='{type(peers)}'") return peers