# Acquire lock
locking.acquire()
- logger.info("Fetching software list ...")
- raw = utils.fetch_url(
- "https://fediverse.observer",
- network.web_headers,
- (config.get("connection_timeout"), config.get("read_timeout"))
- ).text
- logger.debug("raw[%s]()=%d", type(raw), len(raw))
-
- doc = bs4.BeautifulSoup(raw, features="html.parser")
- logger.debug("doc[]='%s'", type(doc))
+ types = list()
+ if args.software is None:
+ logger.info("Fetching software list ...")
+ raw = utils.fetch_url(
+ "https://fediverse.observer",
+ network.web_headers,
+ (config.get("connection_timeout"), config.get("read_timeout"))
+ ).text
+ logger.debug("raw[%s]()=%d", type(raw), len(raw))
- items = doc.find("div", {"aria-labelledby": "navbarDropdownMenuSoftwares"}).findAll("a", {"class": "dropdown-item"})
- logger.debug("items[]='%s'", type(items))
+ doc = bs4.BeautifulSoup(raw, features="html.parser")
+ logger.debug("doc[]='%s'", type(doc))
- types = list()
+ items = doc.find("div", {"aria-labelledby": "navbarDropdownMenuSoftwares"}).findAll("a", {"class": "dropdown-item"})
+ logger.debug("items[]='%s'", type(items))
- logger.info("Checking %d menu items ...", len(items))
- for item in items:
- logger.debug("item[%s]='%s'", type(item), item)
- if item.text.lower() == "all":
- logger.debug("Skipping 'All' menu entry ...")
- continue
+ logger.info("Checking %d menu items ...", len(items))
+ for item in items:
+ logger.debug("item[%s]='%s'", type(item), item)
+ if item.text.lower() == "all":
+ logger.debug("Skipping 'All' menu entry ...")
+ continue
- logger.debug("Appending item.text='%s' ...", item.text)
- types.append(tidyup.domain(item.text))
+ logger.debug("Appending item.text='%s' ...", item.text)
+ types.append(tidyup.domain(item.text))
+ else:
+ logger.info("Adding args.software='%s' as type ...", args.software)
+ types.append(args.software)
logger.info("Fetching %d different table data ...", len(types))
for software in types:
logger.debug("software[%s]='%s'", type(software), software)
if software is not None and software != "":
- logger.info("domain='%s' is generated by '%s'", domain, software)
+ logger.info("domain='%s' is generated by software='%s'", domain, software)
instances.set_detection_mode(domain, "GENERATOR")
elif isinstance(site_name, bs4.element.Tag) and isinstance(site_name.get("content"), str):
logger.debug("Found property=og:site_name, domain='%s'", domain)