logger.debug("found[]='%s'", type(found))
if found is None:
logger.info("domain='%s' has no HTML blocklist, checking scripts ...", domain)
- blocking = parse_script(doc, "blocked")
-
- logger.debug("blocking()=%d - EXIT!", len(blocking))
- return blocking
+ peers = parse_script(doc, "blocked")
+
+ logger.debug("domain='%s' has %d peer(s).", domain, len(peers))
+ for blocked in peers:
+ logger.debug("Appending blocker='%s',blocked='%s',block_level='reject' ...", domain, blocked)
+ blocklist.append({
+ "blocker" : domain,
+ "blocked" : blocked,
+ "reason" : None,
+ "block_level": "reject",
+ })
+
+ logger.debug("blocklist()=%d - EXIT!", len(blocklist))
+ return blocklist
blocking = found.find_next(["ul","table"]).findAll("a")
logger.debug("Found %d blocked instance(s) ...", len(blocking))