def fetch_bkali(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("Invoking locking.acquire() ...")
+ locking.acquire()
+
api_domain = "gql.apis.bka.li"
if apis.is_recent(api_domain):
logger.info("API from api_domain='%s' has recently being accessed - EXIT!", api_domain)
logger.debug("domains()=%d", len(domains))
if len(domains) > 0:
- locking.acquire()
-
logger.info("Adding %d new instances ...", len(domains))
for domain in domains:
try:
logger.warning("args.domain='%s' is not registered, please run ./utils.py fetch_instances '%s' first.", args.domain, args.domain)
return 102
+ logger.debug("Invoking locking.acquire() ...")
locking.acquire()
if args.domain is not None and args.domain != "":
def fetch_observer(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("Invoking locking.acquire() ...")
+ locking.acquire()
+
api_domain = "fediverse.observer"
if apis.is_recent(api_domain):
logger.info("API from api_domain='%s' has recently being accessed - EXIT!", api_domain)
logger.debug("api_domain='%s' has not been recently used, marking ...", api_domain)
apis.update(api_domain)
- # Acquire lock
- locking.acquire()
-
types = list()
if args.software is None:
logger.info("Fetching software list ...")
def fetch_todon_wiki(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("Invoking locking.acquire() ...")
+ locking.acquire()
+
api_domain = "wiki.todon.eu"
if apis.is_recent(api_domain):
logger.info("API from api_domain='%s' has recently being accessed - EXIT!", api_domain)
logger.debug("api_domain='%s' has not been recently used, marking ...", api_domain)
apis.update(api_domain)
- locking.acquire()
-
blocklist = {
"silenced": list(),
"reject": list(),
def fetch_cs(args: argparse.Namespace):
logger.debug("args[]='%s' - CALLED!", type(args))
+
+ logger.debug("Invoking locking.acquire() ...")
+ locking.acquire()
+
extensions = [
"extra",
"abbr",
logger.debug("domains[silenced]()=%d,domains[reject]()=%d", len(domains["silenced"]), len(domains["reject"]))
blockdict = list()
if len(domains) > 0:
- locking.acquire()
for block_level in domains:
logger.info("block_level='%s' has %d row(s)", block_level, len(domains[block_level]))
def fetch_fba_rss(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+
domains = list()
+ logger.debug("Invoking locking.acquire() ...")
+ locking.acquire()
+
+ components = urlparse(args.feed)
+
+ if apis.is_recent(components.netloc):
+ logger.info("API from components.netloc='%s' has recently being accessed - EXIT!", components.netloc)
+ return 0
+ else:
+ logger.debug("components.netloc='%s' has not been recently used, marking ...", components.netloc)
+ apis.update(components.netloc)
+
logger.info("Fetch FBA-specific RSS args.feed='%s' ...", args.feed)
response = utils.fetch_url(args.feed, network.web_headers, (config.get("connection_timeout"), config.get("read_timeout")))
logger.debug("domains()=%d", len(domains))
if len(domains) > 0:
- locking.acquire()
-
logger.info("Adding %d new instances ...", len(domains))
for domain in domains:
try:
def fetch_fbabot_atom(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("Invoking locking.acquire() ...")
+ locking.acquire()
+
api_domain = "ryana.agency"
if apis.is_recent(api_domain):
logger.info("API from api_domain='%s' has recently being accessed - EXIT!", api_domain)
logger.debug("domains()=%d", len(domains))
if len(domains) > 0:
- locking.acquire()
-
logger.info("Adding %d new instances ...", len(domains))
for domain in domains:
logger.debug("domain='%s'", domain)
def fetch_instances(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("args.domain='%s' - checking ...", args.domain)
+ if not validators.domain(args.domain):
+ logger.warning("args.domain='%s' is not valid.", args.domain)
+ return 100
+ elif blacklist.is_blacklisted(args.domain):
+ logger.warning("args.domain='%s' is blacklisted, won't check it!", args.domain)
+ return 101
+
+ logger.debug("Invoking locking.acquire() ...")
locking.acquire()
# Initial fetch
def fetch_oliphant(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("Invoking locking.acquire() ...")
+ locking.acquire()
+
api_domain = "codeberg.org"
if apis.is_recent(api_domain):
logger.info("API from api_domain='%s' has recently being accessed - EXIT!", api_domain)
logger.debug("api_domain='%s' has not been recently used, marking ...", api_domain)
apis.update(api_domain)
- locking.acquire()
-
# Base URL
base_url = f"https://{api_domain}/oliphant/blocklists/raw/branch/main/blocklists"
def fetch_txt(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("Invoking locking.acquire() ...")
locking.acquire()
# Static URLs
def fetch_fedipact(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("Invoking locking.acquire() ...")
+ locking.acquire()
+
api_domain = "fedipact.online"
if apis.is_recent(api_domain):
logger.info("API from api_domain='%s' has recently being accessed - EXIT!", api_domain)
logger.debug("api_domain='%s' has not been recently used, marking ...", api_domain)
apis.update(api_domain)
- locking.acquire()
-
response = utils.fetch_url(
f"https://{api_domain}",
network.web_headers,
def fetch_joinfediverse(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("Invoking locking.acquire() ...")
+ locking.acquire()
+
api_domain = "joinfediverse.wiki"
if apis.is_recent(api_domain):
logger.info("API from api_domain='%s' has recently being accessed - EXIT!", api_domain)
logger.debug("api_domain='%s' has not been recently used, marking ...", api_domain)
apis.update(api_domain)
- locking.acquire()
-
raw = utils.fetch_url(
f"https://{api_domain}/FediBlock",
network.web_headers,
def recheck_obfuscation(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("Invoking locking.acquire() ...")
locking.acquire()
if isinstance(args.domain, str) and args.domain != "" and utils.is_domain_wanted(args.domain):
def fetch_fedilist(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("Invoking locking.acquire() ...")
+ locking.acquire()
+
api_domain = "demo.fedilist.com"
if apis.is_recent(api_domain):
logger.info("API from api_domain='%s' has recently being accessed - EXIT!", api_domain)
logger.debug("args.software='%s'", args.software)
url = f"http://{api_domain}/instance/csv?software={args.software}&onion=not"
- locking.acquire()
-
logger.info("Fetching url='%s' ...", url)
response = reqto.get(
url,
def update_nodeinfo(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("Invoking locking.acquire() ...")
locking.acquire()
if args.domain is not None and args.domain != "":
def fetch_instances_social(args: argparse.Namespace) -> int:
logger.debug("args[]='%s' - CALLED!", type(args))
+ logger.debug("Invoking locking.acquire() ...")
+ locking.acquire()
+
api_domain = "instances.social"
if config.get("instances_social_api_key") == "":
logger.debug("api_domain='%s' has not been recently used, marking ...", api_domain)
apis.update(api_domain)
- locking.acquire()
headers = {
"Authorization": f"Bearer {config.get('instances_social_api_key')}",
}