+
+ logger.debug("Invoking utils.deobfuscate(%s, %s) ...", blocked, domain)
+ blocked = utils.deobfuscate(blocked, domain)
+ logger.debug("blocked='%s' - DEOBFUSCATED!", blocked)
+
+ logger.debug("Checking %d blockdict records ...", len(blockdict))
+ for block in blockdict:
+ logger.debug("block[blocked]='%s',blocked='%s'", block["blocked"], blocked)
+ if block["blocked"] == blocked:
+ logger.debug("Updating reason='%s' for blocker='%s'", reason, block["blocked"])
+ block["reason"] = reason
+
+ elif "quarantined_instances_info" in data and "quarantined_instances" in data["quarantined_instances_info"]:
+ logger.debug("Found 'quarantined_instances_info' in JSON response: domain='%s'", domain)
+ found = True
+ block_level = "quarantined"
+
+ #print(data["quarantined_instances_info"])
+ rows = data["quarantined_instances_info"]["quarantined_instances"]
+ for blocked in rows:
+ logger.debug("blocked='%s' - BEFORE!", 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]:
+ logger.warning("Cannot find blocked='%s' in rows()=%d,domain='%s' - BREAK!", blocked, len(rows), domain)
+ break
+ elif blocked == "":
+ logger.warning("blocked is empty after tidyup.domain(): domain='%s',block_level='%s'", domain, block_level)
+ continue
+ elif not domain_helper.is_wanted(blocked):
+ logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked)
+ continue
+
+ logger.debug("Invoking utils.deobfuscate(%s, %s) ...", blocked, domain)
+ blocked = utils.deobfuscate(blocked, domain)
+
+ logger.debug("blocked='%s' - DEOBFUSCATED!", blocked)
+ if not domain_helper.is_wanted(blocked):
+ logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked)
+ continue
+
+ logger.debug("Checking %d blockdict records ...", len(blockdict))
+ for block in blockdict:
+ logger.debug("block[blocked]='%s',blocked='%s'", block["blocked"], blocked)
+ if block["blocked"] == blocked:
+ logger.debug("Updating reason='%s' for blocker='%s'", reason, block["blocked"])
+ block["reason"] = reason
+ else:
+ logger.warning("Cannot find 'mrf_simple_info' or 'quarantined_instances_info' in JSON reply: domain='%s'", domain)
+
+ if not found:
+ logger.debug("Did not find any useable JSON elements, domain='%s', continuing with /about page ...", domain)
+ blocklist = fetch_blocks_from_about(domain)
+
+ logger.debug("blocklist()=%d", len(blocklist))
+ if len(blocklist) > 0:
+ logger.info("Checking %d different blocklists ...", len(blocklist))
+ for block_level in blocklist:
+ logger.debug("block_level='%s'", block_level)
+ rows = blocklist[block_level]
+
+ 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"])