]> git.mxchange.org Git - fba.git/blobdiff - fba/http/federation.py
Continued:
[fba.git] / fba / http / federation.py
index 540f7416943f5a7dcdd29c34ade2a9d0b5a9919e..895a5090bb7c911263a04936a779224158dd9a4e 100644 (file)
@@ -497,14 +497,6 @@ def fetch_generator_from_path(domain: str, path: str = "/") -> str:
             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"))
-
-            logger.debug("software[%s]='%s'", type(software), software)
-            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"))
@@ -513,6 +505,14 @@ 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(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"))
+
+            logger.debug("software[%s]='%s'", type(software), software)
+            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 not domain_helper.is_in_url(domain, response.url):
         logger.warning("domain='%s' doesn't match response.url='%s', maybe redirect to other domain?", domain, response.url)