# Cookies storage
_cookies = {}
-def store (domain: str, cookies: dict):
+def store(domain: str, cookies: dict):
logger.debug("domain='%s',cookies()=%d - CALLED!", domain, len(cookies))
domain_helper.raise_on(domain)
if not isinstance(cookies, dict):
logger.debug("_cookies[%s]()=%d - EXIT!", domain, len(_cookies[domain]))
return _cookies[domain]
-def has (domain: str) -> bool:
+def has(domain: str) -> bool:
logger.debug("domain='%s' - CALLED!", domain)
domain_helper.raise_on(domain)
logger.debug("has_cookies='%s' - EXIT!", has_cookies)
return has_cookies
-def clear (domain: str):
+def clear(domain: str):
logger.debug("domain='%s' - CALLED!", domain)
domain_helper.raise_on(domain)
logger.debug("Checking lists()=%d ...", len(lists))
for row in lists:
logger.debug("row[%s]='%s", type(row), row)
+
if not isinstance(row, dict):
raise ValueError(f"row[]='{type(row)}' is not of type 'dict'")
elif not key in row:
raise ValueError(f"Parameter command[]='{type(command)}' is not of type 'str'")
elif command == "":
raise ValueError("Parameter 'command' is empty")
+ elif blacklist.is_blacklisted(blocked):
+ raise ValueError(f"blocked='{blocked}' is blacklisted but function was invoked")
+ elif blacklist.is_blacklisted(blocker):
+ raise ValueError(f"blocker='{blocker}' is blacklisted but function was invoked")
logger.debug("blocked='%s' - BEFORE!", blocked)
blocked = utils.deobfuscate(blocked, blocker)
raise ValueError(f"Parameter block_level[]='{type(block_level)}' is not of type 'str'")
elif block_level == "":
raise ValueError("Parameter block_level is empty")
+ elif blacklist.is_blacklisted(blocker):
+ raise ValueError(f"blocker='{blocker}' is blacklisted but function was invoked")
elif blacklist.is_blacklisted(blocked):
raise ValueError(f"blocked='{blocked}' is blacklisted but function was invoked")
raise ValueError(f"command[]='{command}' is not of type 'str'")
elif command == "":
raise ValueError("Parameter 'command' is empty")
+ elif blacklist.is_blacklisted(blocker):
+ raise ValueError(f"blocker='{blocker}' is blacklisted but function was invoked")
logger.debug("Setting last_blocked for blocker='%s' ...", blocker)
instances.set_last_blocked(blocker)