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"))
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)