]> git.mxchange.org Git - fba.git/commitdiff
Fixed:
authorRoland Häder <roland@mxchange.org>
Tue, 13 Jun 2023 10:08:11 +0000 (12:08 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 13 Jun 2023 10:08:11 +0000 (12:08 +0200)
- some instances have broken API at /api/v1/instance/domain_blocks which returns
  nodeinfo (see masto1.iana.de)

fba/networks/mastodon.py

index 6470292c1ab01afb7185c5cd03252f6bb3e94723..32655e75e7cab7ed1deb66cc4922bd645ed90b3c 100644 (file)
@@ -189,6 +189,12 @@ def fetch_blocks(domain: str, origin: str, nodeinfo_url: str):
         if len(blocklist) > 0:
             print(f"INFO: Checking {len(blocklist)} entries from domain='{domain}',software='mastodon' ...")
             for block in blocklist:
+                # Check type
+                # DEBUG: print(f"DEBUG: block[]='{type(block)}'")
+                if not isinstance(block, dict):
+                    print(f"DEBUG: block[]='{type(block)}' is of type 'dict' - SKIPPED!")
+                    continue
+
                 # Map block -> entry
                 # DEBUG: print(f"DEBUG: block[{type(block)}]='{block}'")
                 entry = {