]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 6 Sep 2023 00:43:17 +0000 (02:43 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 6 Sep 2023 00:46:12 +0000 (02:46 +0200)
- skip empty domain names
- also strip spaces on start/end away

fba/commands.py

index 89e9ed4304aecfc063882e52e61dea43a54b07cd..7611f5560c13ee7e3fab0d1e597fd7525b2c37ab 100644 (file)
@@ -1151,16 +1151,16 @@ def fetch_txt(args: argparse.Namespace) -> int:
         logger.debug("response.ok='%s',response.status_code=%d,response.text()=%d", response.ok, response.status_code, len(response.text))
         if response.ok and response.status_code == 200 and response.text != "":
             logger.debug("Returned %d Bytes for processing", len(response.text.strip()))
-            domains = response.text.split("\n")
+            domains = response.text.strip().split("\n")
 
             logger.info("Processing %d domains ...", len(domains))
             for domain in domains:
                 logger.debug("domain='%s' - BEFORE!", domain)
-                domain = tidyup.domain(domain)
+                domain = tidyup.domain(domain) if domain != None and domain != "" else None
 
                 logger.debug("domain='%s' - AFTER!", domain)
-                if domain == "":
-                    logger.debug("domain is empty - SKIPPED!")
+                if domain is None or domain == "":
+                    logger.debug("domain='%s' is empty - SKIPPED!", domain)
                     continue
                 elif not domain_helper.is_wanted(domain):
                     logger.debug("domain='%s' is not wanted - SKIPPED!", domain)