]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Tue, 11 Jul 2023 21:27:34 +0000 (23:27 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 11 Jul 2023 21:27:34 +0000 (23:27 +0200)
- added IDNA encoding

fba/commands.py
fba/helpers/blacklist.py

index 5047b5a9ce50f19651f1d9806301ef67948dac9b..b96ab65af33bddc74f0b4567687645c10f4d4e62 100644 (file)
@@ -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"])
index 12c1655ca4075e1e6a30974cdafa81fed42bf312..bf75295eceb56694e3d9e0caeb9f522b9f505f0b 100644 (file)
@@ -31,7 +31,6 @@ blacklist = [
     # Similar troll
     "4chan.icu",
     # Flooder (?)
-    "social.shrimpcam.pw",
     "mastotroll.netz.org",
     "lhr.life",
     "localhost.run",