import logging
import re
+from fba.helpers import software as software_helper
+
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
software = temp[0:end].strip()
if " version" in software:
logger.debug("software='%s' contains word ' version'", software)
- software = strip_until(software, " version")
+ software = software_helper.strip_until(software, " version")
logger.debug("software='%s' - EXIT!", software)
return software
platform = doc.find("meta", {"property": "og:platform"})
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"))
-
- logger.debug("software[%s]='%s'", type(software), software)
- if software is not None and software != "":
- logger.info("domain='%s' is generated by software='%s' - Setting detection_mode=GENERATOR ...", domain, software)
- instances.set_detection_mode(domain, "GENERATOR")
- elif isinstance(platform, bs4.element.Tag) and isinstance(platform.get("content"), str):
+ if 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"))
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 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"))
+
+ logger.debug("software[%s]='%s'", type(software), software)
+ if software is not None and software != "":
+ logger.info("domain='%s' is generated by software='%s' - Setting detection_mode=GENERATOR ...", 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)
software = tidyup.domain(site_name.get("content"))
<ol>
<li><b>AUTO_DISCOVERY</b>: <code>/.well-known/nodeinfo</code> was reachable and software type was found in nodeinfo response</li>
<li><b>STATIC_CHECK</b>: Node information was found by probing for well-known URLs</li>
- <li><b>GENERATOR</b>: Meta data <code>generator</code> was found in HTML code</li>
<li><b>PLATFORM</b>: Meta data <code>og:platform</code> was found in HTML code</li>
+ <li><b>GENERATOR</b>: Meta data <code>generator</code> was found in HTML code</li>
<li><b>SITE_NAME</b>: Meta data <code>og:site_name</code> was found in HTML code</li>
<li><b>None</b>: the instance was not reachable or the used software was not stated</li>
</ol>