]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Tue, 11 Jul 2023 05:37:16 +0000 (07:37 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 11 Jul 2023 05:39:15 +0000 (07:39 +0200)
- nope, the returned 'blocking' list is differently structured

fba/networks/lemmy.py

index be1b12de7d3af04af6c7ee33e777b98ef9c6fd39..1306bb8bf962f176687624855fefc9ae40aa248d 100644 (file)
@@ -166,10 +166,20 @@ def fetch_blocks(domain: str, nodeinfo_url: str) -> list:
             logger.debug("found[]='%s'", type(found))
             if found is None:
                 logger.info("domain='%s' has no HTML blocklist, checking scripts ...", domain)
-                blocking = parse_script(doc, "blocked")
-
-                logger.debug("blocking()=%d - EXIT!", len(blocking))
-                return blocking
+                peers = parse_script(doc, "blocked")
+
+                logger.debug("domain='%s' has %d peer(s).", domain, len(peers))
+                for blocked in peers:
+                    logger.debug("Appending blocker='%s',blocked='%s',block_level='reject' ...", domain, blocked)
+                    blocklist.append({
+                        "blocker"    : domain,
+                        "blocked"    : blocked,
+                        "reason"     : None,
+                        "block_level": "reject",
+                    })
+
+                logger.debug("blocklist()=%d - EXIT!", len(blocklist))
+                return blocklist
 
             blocking = found.find_next(["ul","table"]).findAll("a")
             logger.debug("Found %d blocked instance(s) ...", len(blocking))