From: Roland Häder Date: Wed, 6 Sep 2023 00:43:17 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e30b8b06f9a0bb6eedf42c7a2559eb63976b8765;p=fba.git Continued: - skip empty domain names - also strip spaces on start/end away --- 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)