logger = logging.getLogger(__name__)
#logger.setLevel(logging.DEBUG)
-with open("config.json", 'r', encoding='utf-8') as f:
+with open("config.json", "r", encoding="utf-8") as f:
logger.debug("Loading configuration file ...")
_config = json.loads(f.read())
_config["max_crawl_depth"] = min(_config["max_crawl_depth"], (sys.getrecursionlimit() - 50))
elif not isinstance(cookies, dict):
raise TypeError(f"Parameter cookies[]='{type(cookies)}' has not expected type 'dict'")
+ logger.debug("Setting %d cookie(s) for domain='%s'", len(cookies), domain)
_cookies[domain] = cookies
logger.debug("EXIT!")
if blacklist.is_blacklisted(domain):
raise RuntimeError(f"domain='{domain}' is blacklisted but function was invoked")
- elif domain not in _cookies:
+ elif not has(domain):
+ logger.debug("domain='%s' has no cookies set, returning empty dict - EXIT!", domain)
return []
logger.debug("_cookies[%s]()=%d - EXIT!", domain, len(_cookies[domain]))
logger.debug("domain='%s' - CALLED!", domain)
raise_on(domain)
+ logger.debug("domain='%s' - BEFORE!", domain)
punycode = domain.lstrip(".").split("?")[0]
logger.debug("punycode='%s' - AFTER!", punycode)
raise TypeError(f"software[]='{type(software)}' is not type 'str'")
elif software == "":
raise ValueError("Parameter 'software' is an empty string")
- elif software.startswith("re:"):
+
+ if software.startswith("re:"):
logger.debug("Cutting prefix 're:' from software='%s' ...", software)
software = software.split(":")[1]