if blacklist.is_blacklisted(domain):
raise ValueError(f"domain='{domain}' is blacklisted but function was invoked")
-
- if domain not in _cookies:
+ elif domain not in _cookies:
return dict()
logger.debug("_cookies[%s]()=%d - EXIT!", domain, len(_cookies[domain]))
logger.debug("domain='%s',url='%s' - CALLED!", domain, url)
raise_on(domain)
- if not isinstance(url, str):
+ if blacklist.is_blacklisted(domain):
+ raise ValueError(f"domain='{domain}' is blacklisted but function was invoked")
+ elif not isinstance(url, str):
raise ValueError(f"Parameter url[]='{type(url)}' is not of type 'str'")
elif url == "":
raise ValueError("Parameter 'url' is empty")
import reqto
import requests
+from fba.helpers import blacklist
from fba.helpers import config
from fba.helpers import cookies
from fba.helpers import domain as domain_helper
logger.debug("domain='%s',headers()=%d - CALLED!", domain, len(headers))
domain_helper.raise_on(domain)
- if not isinstance(headers, dict):
+ if blacklist.is_blacklisted(domain):
+ raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ elif not isinstance(headers, dict):
raise ValueError(f"Parameter headers[]='{type(headers)}' is not of type 'dict'")
# Default headers with no CSRF
logger.debug("domain='%s' - CALLED!", domain)
domain_helper.raise_on(domain)
- if not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
- elif blacklist.is_blacklisted(domain):
+ if blacklist.is_blacklisted(domain):
raise Exception(f"domain='{domain}' is blacklisted but function was invoked")
+ elif not instances.is_registered(domain):
+ raise Exception(f"domain='{domain}' is not registered but function is invoked.")
# Init block list
blocklist = list()
from fba import database
+from fba.helpers import blacklist
from fba.helpers import config
from fba.helpers import domain as domain_helper
logger.debug("domain='%s',error[]='%s' - CALLED!", domain, type(error))
domain_helper.raise_on(domain)
- if config.get("write_error_log").lower() != "true":
+ if blacklist.is_blacklisted(domain):
+ raise ValueError(f"domain='{domain}' is blacklisted but function was invoked")
+ elif config.get("write_error_log").lower() != "true":
logger.debug("Writing to error_log is disabled in configuruation file - EXIT!")
return
logger.debug("domain='%s' - CALLED!", domain)
domain_helper.raise_on(domain)
- if not instances.is_registered(domain):
- raise Exception(f"domain='{domain}' is not registered but function is invoked.")
- elif blacklist.is_blacklisted(domain):
+ if blacklist.is_blacklisted(domain):
raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ elif not instances.is_registered(domain):
+ raise Exception(f"domain='{domain}' is not registered but function is invoked.")
blocklist = list()
block_tag = None
if blacklist.is_blacklisted(domain):
raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ elif not instances.is_registered(domain):
+ raise Exception(f"domain='{domain}' is not registered but function is invoked.")
peers = list()
if blacklist.is_blacklisted(domain):
raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ elif not instances.is_registered(domain):
+ raise Exception(f"domain='{domain}' is not registered but function is invoked.")
logger.debug("domain='%s' is misskey, sending API POST request ...", domain)
peers = list()
if blacklist.is_blacklisted(domain):
raise Exception(f"domain='{domain}' is blacklisted but function is invoked.")
+ elif not instances.is_registered(domain):
+ raise Exception(f"domain='{domain}' is not registered but function is invoked.")
# Init variables
peers = list()
import bs4
import requests
+from fba.helpers import blacklist
from fba.helpers import config
from fba.helpers import domain as domain_helper
from fba.helpers import tidyup
logger.debug("domain='%s',blocker='%s',domain_hash='%s' - CALLED!", domain, blocker, domain_hash)
domain_helper.raise_on(blocker)
- if not isinstance(domain, str):
- raise ValueError(f"Parameter domain[]='{type(domain)}' is not of type 'str'")
- elif domain == "":
- raise ValueError("Parameter domain is empty")
+ if blacklist.is_blacklisted(domain):
+ raise ValueError(f"domain='{domain}' is blacklisted but function was invoked")
elif not isinstance(domain_hash, str) and domain_hash is not None:
raise ValueError(f"Parameter domain_hash[]='{type(domain_hash)}' is not of type 'str'")