raise ValueError(f"Parameter url[]='{type(url)}' is not of type 'str'")
elif url == "":
raise ValueError("Parameter 'url' is empty")
+ elif not validators.url(url):
+ raise ValueError(f"Parameter url='{url}' is not a valid URL")
elif domain + url in _cache["is_in_url"]:
logger.debug("Returning cached is_in_url='%s' - EXIT!", _cache["is_in_url"][domain + url])
return _cache["is_in_url"][domain + url]
raise ValueError(f"url[]='{url}' is not of type 'str'")
elif url == "":
raise ValueError("Parameter 'url' is empty")
+ elif not validators.url(url):
+ raise ValueError(f"Parameter url='{url}' is not a valid URL")
elif not isinstance(command, str):
raise ValueError(f"command[]='{command}' is not of type 'str'")
elif command == "":
def find_domains(tag: bs4.element.Tag) -> list:
logger.debug("tag[]='%s' - CALLED!", type(tag))
+
if not isinstance(tag, bs4.element.Tag):
raise ValueError(f"Parameter tag[]='{type(tag)}' is not type of bs4.element.Tag")
elif len(tag.select("tr")) == 0:
def add_peers(rows: dict) -> list:
logger.debug("rows[]='%s' - CALLED!", type(rows))
+
if not isinstance(rows, dict):
raise ValueError(f"Parameter rows[]='{type(rows)}' is not of type 'dict'")
raise ValueError(f"Parameter url[]='{type(url)}' is not of type 'str'")
elif url == "":
raise ValueError("Parameter 'url' is empty")
+ elif not validators.url(url):
+ raise ValueError(f"Parameter url='{url}' is not a valid URL")
elif not isinstance(timeout, tuple):
raise ValueError(f"timeout[]='{type(timeout)}' is not of type 'tuple'")
raise ValueError(f"Parameter url[]='{type(url)}' is not of type 'str'")
elif url == "":
raise ValueError("Parameter 'url' is empty")
+ elif not validators.url(url):
+ raise ValueError(f"Parameter url='{url}' is not a valid URL")
# Set timestamp
_set_data("nodeinfo_url", domain, url)
import bs4
import requests
+import validators
from fba.helpers import blacklist
from fba.helpers import config
raise ValueError(f"Parameter url[]='{type(url)}' is not of type 'str'")
elif url == "":
raise ValueError("Parameter 'url' is empty")
+ elif not validators.url(url):
+ raise ValueError(f"Parameter url='{url}' is not a valid URL")
elif not isinstance(headers, dict):
raise ValueError(f"Parameter headers[]='{type(headers)}' is not of type 'dict'")
elif not isinstance(timeout, tuple):