]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 18 Oct 2023 21:27:43 +0000 (23:27 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 18 Oct 2023 21:27:43 +0000 (23:27 +0200)
- more cases of empty strings

fba/http/federation.py

index 92daf564feaaf864d37040a68d56a9ab24baf70b..25ec633b85ab9556fedb4b1d86cc2f728fe35479 100644 (file)
@@ -286,7 +286,7 @@ def fetch_generator_from_path(domain: str, path: str = "/") -> str:
         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"))
 
@@ -294,7 +294,7 @@ def fetch_generator_from_path(domain: str, path: str = "/") -> str:
             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"))