raise ValueError(f"Parameter domain[]='{type(domain)}' is not of type 'str'")
elif domain == "":
raise ValueError("Parameter 'domain' is empty")
+ elif "raise_on" in _cache and domain in _cache["raise_on"]:
+ logger.debug("Returning cached is_found='%s' - EXIT!", _cache["raise_on"][domain])
+ return _cache["raise_on"][domain]
elif domain.lower() != domain:
raise ValueError(f"Parameter domain='{domain}' must be all lower-case")
elif not validators.domain(domain.split("/")[0]):
raise ValueError(f"domain='{domain}' is a domain for reversed IP addresses, 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 "raise_on" in _cache:
+ logger.debug("Initializing cache for function 'raise_on' ...")
+ _cache["raise_on"] = {}
+ _cache["raise_on"][domain] = True
logger.debug("EXIT!")
def is_in_url(domain: str, url: str) -> bool: