From e30b8b06f9a0bb6eedf42c7a2559eb63976b8765 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 6 Sep 2023 02:43:17 +0200 Subject: [PATCH] Continued: - skip empty domain names - also strip spaces on start/end away --- fba/commands.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fba/commands.py b/fba/commands.py index 89e9ed4..7611f55 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -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) -- 2.39.5