- if blocked == "":
- print("WARNING: blocked is empty after tidyup.domain():", domain, block_level)
- continue
- elif blacklist.is_blacklisted(blocked):
- # DEBUG: print(f"DEBUG: blocked='{blocked}' is blacklisted - skipping!")
- continue
- elif blocked.count("*") > 0:
- # Obscured domain name with no hash
- row = instances.deobscure("*", blocked)
-
- # DEBUG: print(f"DEBUG: row[]='{type(row)}'")
- if row is None:
- print(f"WARNING: Cannot deobsfucate blocked='{blocked}',domain='{domain}',origin='{origin}' - SKIPPED!")
- continue
-
- # DEBUG: print(f"DEBUG: blocked='{blocked}' de-obscured to '{row[0]}'")
- blocked = row[0]
- origin = row[1]
- nodeinfo_url = row[2]
- elif blocked.count("?") > 0:
- # Obscured domain name with no hash
- row = instances.deobscure("?", blocked)
-
- # DEBUG: print(f"DEBUG: row[]='{type(row)}'")
- if row is None:
- print(f"WARNING: Cannot deobsfucate blocked='{blocked}',domain='{domain}',origin='{origin}' - SKIPPED!")
- continue
-
- # DEBUG: print(f"DEBUG: blocked='{blocked}' de-obscured to '{row[0]}'")
- blocked = row[0]
- origin = row[1]
- nodeinfo_url = row[2]
-
- # DEBUG: print(f"DEBUG: blocked='{blocked}'")
- if not validators.domain(blocked):
- print(f"WARNING: blocked='{blocked}',software='pleroma' is not a valid domain name - SKIPPED!")
- continue
- elif blocked.endswith(".arpa"):
- print(f"WARNING: blocked='{blocked}' is a reversed .arpa domain and should not be used generally.")
- continue
- elif blocked.endswith(".tld"):
- print(f"WARNING: blocked='{blocked}' is a fake domain, please don't crawl them!")
+ logger.debug("rows[%s]()=%d'", type(rows), len(rows))
+ for block in rows:
+ logger.debug("Invoking utils.deobfuscate(%s, %s) ...", block["blocked"], domain)
+ block["blocked"] = utils.deobfuscate(block["blocked"], domain)
+
+ logger.debug("block[blocked]='%s' - DEOBFUSCATED!", block["blocked"])
+ if not domain_helper.is_wanted(block["blocked"]):
+ logger.debug("block[blocked]='%s' is not wanted - SKIPPED!", block["blocked"])