From: Roland Häder Date: Sat, 1 Jul 2023 03:06:11 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=80525c1c647ffc34d577c91e99664145d0e6e7d6;p=fba.git Continued: - parsed more headers for more block lists --- diff --git a/fba/networks/pleroma.py b/fba/networks/pleroma.py index 435d7ce..d675025 100644 --- a/fba/networks/pleroma.py +++ b/fba/networks/pleroma.py @@ -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)) diff --git a/fba/utils.py b/fba/utils.py index cd2db4d..5d794ff 100644 --- a/fba/utils.py +++ b/fba/utils.py @@ -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)