software = federation.determine_software(row["domain"])
logger.debug("Determined software='%s'", software)
- if software != row["software"]:
+ if software != row["software"] and software is not None:
logger.warning("Software type has changed from '%s' to '%s'!", row["software"], software)
instances.set_software(row["domain"], software)
logger.debug("doc[]='%s'", type(doc))
generator = doc.find("meta", {"name" : "generator"})
site_name = doc.find("meta", {"property": "og:site_name"})
+ platform = doc.find("meta", {"property": "og:platform"})
- logger.debug("generator[]='%s',site_name[]='%s'", type(generator), type(site_name))
+ logger.debug("generator[]='%s',site_name[]='%s',platform[]='%s'", type(generator), type(site_name), type(platform))
if isinstance(generator, bs4.element.Tag) and isinstance(generator.get("content"), str):
logger.debug("Found generator meta tag: domain='%s'", domain)
software = tidyup.domain(generator.get("content"))
if software is not None and software != "":
logger.debug("domain='%s' has og:site_name='%s' - Setting detection_mode=SITE_NAME ...", domain, software)
instances.set_detection_mode(domain, "SITE_NAME")
+ elif isinstance(platform, bs4.element.Tag) and isinstance(platform.get("content"), str):
+ logger.debug("Found property=og:platform, domain='%s'", domain)
+ software = tidyup.domain(platform.get("content"))
+
+ logger.debug("software[%s]='%s'", type(software), software)
+ if software is not None and software != "":
+ logger.debug("domain='%s' has og:platform='%s' - Setting detection_mode=PLATFORM ...", domain, software)
+ instances.set_detection_mode(domain, "PLATFORM")
elif domain != components.netloc:
logger.warning("domain='%s' doesn't match components.netloc='%s', maybe redirect to other domain?", domain, components.netloc)
message = f"Redirect from domain='{domain}' to components.netloc='{components.netloc}'"