def add(domain: str, error: dict):
logger.debug("domain='%s',error[]='%s' - CALLED!", domain, type(error))
domain_helper.raise_on(domain)
+
if config.get("write_error_log").lower() != "true":
logger.debug("Writing to error_log is disabled in configuruation file - EXIT!")
return
def deobfuscate(char: str, domain: str, blocked_hash: str = None) -> tuple:
logger.debug("char='%s',domain='%s',blocked_hash='%s' - CALLED!", char, domain, blocked_hash)
+ domain_helper.raise_on(domain)
- if not isinstance(domain, str):
- raise ValueError(f"Parameter domain[]='{type(domain)}' is not 'str'")
- elif domain == "":
- raise ValueError("Parameter 'domain' is empty")
- elif domain.lower() != domain:
- raise ValueError(f"Parameter domain='{domain}' must be all lower-case")
- elif domain.endswith(".arpa"):
- raise ValueError(f"domain='{domain}' is a domain for reversed IP addresses, please don't crawl them!")
- elif domain.endswith(".onion"):
- raise ValueError(f"domain='{domain}' is a TOR domain, please don't crawl them!")
- elif domain.endswith(".tld"):
- raise ValueError(f"domain='{domain}' is a fake domain, please don't crawl them!")
- elif not isinstance(char, str):
+ if not isinstance(char, str):
raise ValueError(f"Parameter char[]='{type(char)}' is not 'str'")
elif char == "":
raise ValueError("Parameter 'char' is empty")