elif path == "":
raise ValueError("Parameter 'path' is empty")
- logger.debug("domain='%s',path='%s' - CALLED!", domain, path)
software = None
logger.debug("Fetching path='%s' from domain='%s' ...", path, domain)
app_name = doc.find("meta", {"name" : "application-name"})
logger.debug("generator[]='%s',site_name[]='%s',platform[]='%s',app_name[]='%s'", type(generator), type(site_name), type(platform), type(app_name))
- if isinstance(platform, bs4.element.Tag) and isinstance(platform.get("content"), str):
+ if isinstance(platform, bs4.element.Tag) and isinstance(platform.get("content"), str) and platform.get("content") != "":
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):
+ elif isinstance(generator, bs4.element.Tag) and isinstance(generator.get("content"), str) and generator.get("content") != "":
logger.debug("Found generator meta tag: domain='%s'", domain)
software = tidyup.domain(generator.get("content"))
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(app_name, bs4.element.Tag) and isinstance(app_name.get("content"), str):
+ elif isinstance(app_name, bs4.element.Tag) and isinstance(app_name.get("content"), str) and app_name.get("content") != "":
logger.debug("Found property=og:app_name, domain='%s'", domain)
software = tidyup.domain(app_name.get("content"))
if software is not None and software != "":
logger.debug("domain='%s' has application-name='%s' - Setting detection_mode=app_name ...", domain, software)
instances.set_detection_mode(domain, "APP_NAME")
- elif isinstance(site_name, bs4.element.Tag) and isinstance(site_name.get("content"), str):
+ elif isinstance(site_name, bs4.element.Tag) and isinstance(site_name.get("content"), str) and site_name.get("content") != "":
logger.debug("Found property=og:site_name, domain='%s'", domain)
software = tidyup.domain(site_name.get("content"))
logger.debug("Generator for domain='%s' is: '%s'", domain, software)
logger.debug("software[%s]='%s'", type(software), software)
- if software is None:
+ if software is None or software == "":
logger.debug("Returning None - EXIT!")
return None