X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=fba%2Ffederation%2Fpleroma.py;h=5e3bbf1c9ed6fa46b6f76d0143a5fc7caf0b7a0c;hb=08e1a401b7fa6cb46e523076d558ef6c7a07c9b8;hp=764209c918eaddbd93ea37818f4a4810969f63e9;hpb=17e171972c342e8602accc250a8a921a694766bd;p=fba.git diff --git a/fba/federation/pleroma.py b/fba/federation/pleroma.py index 764209c..5e3bbf1 100644 --- a/fba/federation/pleroma.py +++ b/fba/federation/pleroma.py @@ -40,22 +40,22 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str): try: # Blocks blockdict = list() - json = fba.fetch_nodeinfo(domain, nodeinfo_url) + rows = fba.fetch_nodeinfo(domain, nodeinfo_url) - if json is None: + if rows is None: print("WARNING: Could not fetch nodeinfo from domain:", domain) return - elif not "metadata" in json: - print(f"WARNING: json()={len(json)} does not have key 'metadata', domain='{domain}'") + elif not "metadata" in rows: + print(f"WARNING: rows()={len(rows)} does not have key 'metadata', domain='{domain}'") return - elif not "federation" in json["metadata"]: - print(f"WARNING: json()={len(json['metadata'])} does not have key 'federation', domain='{domain}'") + elif not "federation" in rows["metadata"]: + print(f"WARNING: rows()={len(rows['metadata'])} does not have key 'federation', domain='{domain}'") return # DEBUG: print("DEBUG: Updating nodeinfo:", domain) instances.update_last_nodeinfo(domain) - federation = json["metadata"]["federation"] + federation = rows["metadata"]["federation"] if "enabled" in federation: # DEBUG: print("DEBUG: Instance has no block list to analyze:", domain) @@ -187,7 +187,7 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str): # DEBUG: print("DEBUG: Updating block reason:", domain, blocked, reason["reason"]) blocks.update_reason(reason["reason"], domain, blocked, block_level) - # DEBUG: print(f"DEBUG: blockdict()={count(blockdict)") + # DEBUG: print(f"DEBUG: blockdict()={len(blockdict)}") for entry in blockdict: if entry["blocked"] == blocked: # DEBUG: print("DEBUG: Updating entry reason:", blocked)