From: Roland Häder Date: Tue, 11 Jul 2023 21:27:34 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8ca42b4c88d6bccb70f23da435c64d14594366a0;p=fba.git Continued: - added IDNA encoding --- diff --git a/fba/commands.py b/fba/commands.py index 5047b5a..b96ab65 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -1290,7 +1290,7 @@ def fetch_joinfediverse(args: argparse.Namespace) -> int: continue text = tidyup.domain(text.strip()) - logger.debug("text='%s'", text) + logger.debug("text='%s' - AFTER!", text) if text in ["domain", "instance", "subdomain(s)", "block reason(s)"]: logger.debug("Found header: '%s'=%d", text, cnt) block_headers[cnt] = text @@ -1352,17 +1352,20 @@ def fetch_joinfediverse(args: argparse.Namespace) -> int: logger.debug("blocking()=%d", blocking) for block in blocking: logger.debug("block[]='%s'", type(block)) - block["blocked"] = tidyup.domain(block["blocked"]) + if "blocked" not in block: + raise KeyError(f"block()={len(block)} does not have element 'blocked'") + block["blocked"] = tidyup.domain(block["blocked"]).encode("idna").decode("utf-8") logger.debug("block[blocked]='%s' - AFTER!", block["blocked"]) + if block["blocked"] == "": logger.debug("block[blocked] is empty - SKIPPED!") continue elif not utils.is_domain_wanted(block["blocked"]): - logger.warning("blocked='%s' is not wanted - SKIPPED!", block["blocked"]) + logger.warning("block[blocked]='%s' is not wanted - SKIPPED!", block["blocked"]) continue elif instances.is_recent(block["blocked"]): - logger.debug("blocked='%s' has been recently checked - SKIPPED!", block["blocked"]) + logger.debug("block[blocked]='%s' has been recently checked - SKIPPED!", block["blocked"]) continue logger.info("Proccessing blocked='%s' ...", block["blocked"]) diff --git a/fba/helpers/blacklist.py b/fba/helpers/blacklist.py index 12c1655..bf75295 100644 --- a/fba/helpers/blacklist.py +++ b/fba/helpers/blacklist.py @@ -31,7 +31,6 @@ blacklist = [ # Similar troll "4chan.icu", # Flooder (?) - "social.shrimpcam.pw", "mastotroll.netz.org", "lhr.life", "localhost.run",