]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 18 Aug 2025 14:10:44 +0000 (16:10 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 18 Aug 2025 14:10:44 +0000 (16:10 +0200)
- allow obfuscated domains being returned by network-specific `fetch_blocks()`
  invocations

fba/networks/friendica.py
fba/networks/lemmy.py
fba/networks/misskey.py
fba/networks/pleroma.py

index 74d4e7039d2a6b5a8405a5b40a97eaf6a6770cc7..c8a8d24911f7efc95569e2a0b819ee4d7f9cc7a6 100644 (file)
@@ -102,7 +102,7 @@ def fetch_blocks(domain: str) -> list:
         if blocked in [None, ""]:
             logger.warning("line[]='%s' returned empty blocked domain - SKIPPED!", type(line))
             continue
-        elif not domain_helper.is_wanted(blocked):
+        elif blocked.find("*") == -1 and blocked.find("?") == -1 and not domain_helper.is_wanted(blocked):
             logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked)
             continue
 
index 648cee0735f1362134a0cfd4c23a1c19b0c7787e..82a1f9296d4b108c47a830df3837bc91a034b6c1 100644 (file)
@@ -214,7 +214,7 @@ def fetch_blocks(domain: str) -> list:
                     if blocked in [None, ""]:
                         logger.debug("blocked[%s]='%s' is empty after tidyup.domain(): tag.contents[0]='%s' - SKIPPED!", type(blocked), blocked, tag.contents[0])
                         continue
-                    elif not domain_helper.is_wanted(blocked):
+                    elif blocked.find("*") == -1 and blocked.find("?") == -1 and not domain_helper.is_wanted(blocked):
                         logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked)
                         continue
 
index 279e326443d38e9ce3c346a96e73899271af8210..5406bf51072615816e0ff799f7dfac908a27cfdc 100644 (file)
@@ -238,7 +238,7 @@ def fetch_blocks(domain: str) -> list:
                 if blocked in [None, ""]:
                     logger.warning("instance[host]='%s' is None or empty after tidyup.domain() - SKIPPED!", instance["host"])
                     continue
-                elif not domain_helper.is_wanted(blocked):
+                elif blocked.find("*") == -1 and blocked.find("?") == -1 and not domain_helper.is_wanted(blocked):
                     logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked)
                     continue
                 elif "isSuspended" in instance and instance["isSuspended"] and not dict_helper.has_key(blocklist, "blocked", blocked):
index c18542f2866ee7aa5be45308e5892c6a260cfba8..ce6327c319d9db0b8445ea19a5c18e64c737309e 100644 (file)
@@ -128,7 +128,7 @@ def fetch_blocks(domain: str) -> list:
                     logger.debug("blocked[%s]='%s' is empty after tidyup.domain(): domain='%s',block_level='%s' - SKIPPED!", type(blocked), blocked, domain, block_level)
                     continue
                 elif not domain_helper.is_tld_wanted(blocked):
-                    logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked)
+                    logger.debug("blocked='%s' has unwanted TLD - SKIPPED!", blocked)
                     continue
                 elif validators.domain(blocked, rfc_2782=True) and blacklist.is_blacklisted(blocked):
                     logger.debug("blocked='%s' is blacklisted - SKIPPED!")
@@ -160,7 +160,7 @@ def fetch_blocks(domain: str) -> list:
                 logger.debug("blocked[%s]='%s' is empty after tidyup.domain(): domain='%s',block_level='%s'", type(blocked), blocked, domain, block_level)
                 continue
             elif not domain_helper.is_tld_wanted(blocked):
-                logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked)
+                logger.debug("blocked='%s' has an unwanted TLD - SKIPPED!", blocked)
                 continue
             elif validators.domain(blocked, rfc_2782=True) and blacklist.is_blacklisted(blocked):
                 logger.debug("blocked='%s' is blacklisted - SKIPPED!")
@@ -394,7 +394,7 @@ def fetch_blocks_from_about(domain: str) -> dict:
             if blocked in [None, ""]:
                 logger.debug("domain='%s',block_level='%s': blocked='%s' is empty - SKIPPED!", domain, block_level, blocked)
                 continue
-            elif not domain_helper.is_wanted(blocked):
+            elif blocked.find("*") == -1 and blocked.find("?") == -1 and not domain_helper.is_wanted(blocked):
                 logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked)
                 continue