if "links" in nodeinfo:
# DEBUG: print("DEBUG: Found links in nodeinfo():", len(nodeinfo["links"]))
for link in nodeinfo["links"]:
- # DEBUG: print("DEBUG: rel,href:", link["rel"], link["href"])
- if link["rel"] in nodeinfo_identifier:
+ # DEBUG: print(f"DEBUG: link[{type(link)}]='{link}'")
+ if not isinstance(link, dict) or not "rel" in link:
+ print(f"WARNING: link[]='{type(link)}' is not 'dict' or no element 'rel' found")
+ elif link["rel"] in nodeinfo_identifier:
# DEBUG: print("DEBUG: Fetching nodeinfo from:", link["href"])
data = network.fetch_api_url(
link["href"],
software = tidyup.domain(generator.get("content"))
print(f"INFO: domain='{domain}' is generated by '{software}'")
instances.set_detection_mode(domain, "GENERATOR")
- elif isinstance(site_name, bs4.element.Tag):
+ elif isinstance(site_name, bs4.element.Tag) and isinstance(site_name.get("content"), str):
# DEBUG: print("DEBUG: Found property=og:site_name:", domain)
sofware = tidyup.domain(site_name.get("content"))
print(f"INFO: domain='{domain}' has og:site_name='{software}'")
exceptions = (
requests.exceptions.ChunkedEncodingError,
requests.exceptions.ConnectionError,
+ requests.exceptions.InvalidSchema,
requests.exceptions.Timeout,
requests.exceptions.TooManyRedirects,
UnicodeEncodeError