instances.set_total_blocks(blocker, blocking)
blockdict = list()
+ deobfuscated = obfuscated = 0
logger.info("Checking %d entries from blocker='%s',software='%s' ...", len(blocking), blocker, software)
for block in blocking:
continue
elif block["blocked"].find("*") >= 0:
logger.debug("blocker='%s' uses obfuscated domains", blocker)
+ instances.set_has_obfuscation(blocker, True)
+ obfuscated = obfuscated + 1
# Some friendica servers also obscure domains without hash
row = instances.deobfuscate("*", block["blocked"], block["hash"] if "hash" in block else None)
logger.debug("row[]='%s'", type(row))
if row is None:
logger.warning("Cannot deobfuscate blocked='%s',blocker='%s',software='%s' - SKIPPED!", block["blocked"], blocker, software)
- instances.set_has_obfuscation(blocker, True)
continue
+ deobfuscated = deobfuscated + 1
block["blocked"] = row["domain"]
origin = row["origin"]
nodeinfo_url = row["nodeinfo_url"]
elif block["blocked"].find("?") >= 0:
logger.debug("blocker='%s' uses obfuscated domains", blocker)
+ instances.set_has_obfuscation(blocker, True)
+ obfuscated = obfuscated + 1
# Some obscure them with question marks, not sure if that's dependent on version or not
row = instances.deobfuscate("?", block["blocked"], block["hash"] if "hash" in block else None)
logger.debug("row[]='%s'", type(row))
if row is None:
logger.warning("Cannot deobfuscate blocked='%s',blocker='%s',software='%s' - SKIPPED!", block["blocked"], blocker, software)
- instances.set_has_obfuscation(blocker, True)
continue
+ deobfuscated = deobfuscated + 1
block["blocked"] = row["domain"]
origin = row["origin"]
nodeinfo_url = row["nodeinfo_url"]
logger.debug("Invoking cookies.clear(%s) ...", block["blocked"])
cookies.clear(block["blocked"])
+ logger.info("blocker='%s' has %d obfuscated domain(s) and %d of them could be deobfuscated.", block["blocker"], obfuscated, deobfuscated)
+
logger.debug("Checking if blocker='%s' has pending updates ...", blocker)
if instances.has_pending(blocker):
logger.debug("Flushing updates for blocker='%s' ...", blocker)