From: Roland Häder Date: Tue, 11 Jul 2023 05:37:16 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5d76bd7cc590dcc5b9ad4af860702da6714a62ef;p=fba.git Continued: - nope, the returned 'blocking' list is differently structured --- diff --git a/fba/networks/lemmy.py b/fba/networks/lemmy.py index be1b12d..1306bb8 100644 --- a/fba/networks/lemmy.py +++ b/fba/networks/lemmy.py @@ -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))