From: Roland Häder Date: Sun, 15 Sep 2024 16:03:34 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c44b86ca119a6a9e341a6b4eca96838c59f48d6a;p=fba.git Continued: - skip invalid domains after checking them for obfuscation with asterisks or question marks --- diff --git a/fba/commands.py b/fba/commands.py index 4abf8b7..539aee3 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -360,7 +360,7 @@ def fetch_blocks(args: argparse.Namespace) -> int: for block in blocking: logger.debug("blocked='%s',block_level='%s',reason='%s'", block["blocked"], block["block_level"], block["reason"]) - if block["block_level"] == "": + if block["block_level"] in [None, ""]: logger.warning("block_level is empty, blocker='%s',blocked='%s'", block["blocker"], block["blocked"]) continue @@ -428,6 +428,9 @@ def fetch_blocks(args: argparse.Namespace) -> int: block["blocked"] = row["domain"] origin = row["origin"] nodeinfo_url = row["nodeinfo_url"] + elif not validators.domain(block["blocked"], rfc_2782=True): + logger.warning("block[blocked]='%s' is not a valid domain - SKIPPED!", block["blocked"]) + continue logger.debug("Looking up instance by domain, block[blocked]='%s'", block["blocked"]) if block["blocked"] in [None, ""]: