]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 1 Jul 2023 03:06:11 +0000 (05:06 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 1 Jul 2023 03:06:11 +0000 (05:06 +0200)
- parsed more headers for more block lists

fba/networks/pleroma.py
fba/utils.py

index 435d7ce2d3099ea38f5e4ca2cc51f93474365e6b..d675025db7b9085cec9d3d7d3b0e5f13928c4aa8 100644 (file)
@@ -36,10 +36,17 @@ logger = logging.getLogger(__name__)
 # Language mapping X -> English
 language_mapping = {
     # English -> English
+    "filtered media"   : "filtered_media",
     "limited servers"  : "followers_only",
+    "followers-only"   : "followers_only",
+    "media removal"    : "media_removal",
+    "media_removal"    : "media_removal",
+    "media force-set as sensitive": "nsfw",
+    "nsfw"             : "nsfw",
+    "reject"           : "reject",
     "suspended servers": "reject",
     "silenced servers" : "silenced",
-    "filtered media"   : "filtered_media",
+    "removal from \"the whole known network\" timeline": "silenced",
 }
 
 def fetch_blocks(domain: str, nodeinfo_url: str) -> list:
@@ -234,8 +241,8 @@ def fetch_blocks(domain: str, nodeinfo_url: str) -> list:
         rows = data["quarantined_instances_info"]["quarantined_instances"]
         for blocked in rows:
             logger.debug("blocked='%s' - BEFORE!", blocked)
-            blocked = tidyup.domain(blocked)
             reason = tidyup.reason(rows[blocked]["reason"])
+            blocked = tidyup.domain(blocked)
             logger.debug("blocked='%s',reason='%s' - AFTER!", blocked, reason)
 
             if blocked not in rows or "reason" not in rows[blocked]:
@@ -342,6 +349,8 @@ def fetch_blocks_from_about(domain: str) -> dict:
         "filtered_media": [],
         "followers_only": [],
         "silenced"      : [],
+        "nsfw"          : [],
+        "media_removal" : [],
     }
 
     logger.debug("doc[]='%s'", type(doc))
index cd2db4d44776c4b30d1d0b42a284009566ad9322..5d794ffb0c3b5ec852c64295c1b09eb00f363e2c 100644 (file)
@@ -200,7 +200,7 @@ def deobfuscate_domain(domain: str, blocker: str, domain_hash: str = None) -> st
             logger.debug("domain='%s' de-obscured to '%s'", domain, row["domain"])
             domain = row["domain"]
         else:
-            logger.debug("blocker='%s' has domain that cannot be deobfuscated.", blocker)
+            logger.warning("blocker='%s' has domain='%s' that cannot be deobfuscated.", blocker, domain)
             instances.set_has_obfuscation(blocker, True)
     elif domain.find("?") >= 0:
         logger.debug("blocker='%s' uses obfuscated domains", blocker)
@@ -213,7 +213,7 @@ def deobfuscate_domain(domain: str, blocker: str, domain_hash: str = None) -> st
             logger.debug("domain='%s' de-obscured to '%s'", domain, row["domain"])
             domain = row["domain"]
         else:
-            logger.debug("blocker='%s' has domain that cannot be deobfuscated.", blocker)
+            logger.warning("blocker='%s' has domain='%s' that cannot be deobfuscated.", blocker, domain)
             instances.set_has_obfuscation(blocker, True)
     else:
         logger.debug("domain='%s' is not obfuscated", domain)