From: Roland Häder Date: Tue, 27 Jun 2023 03:17:18 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=93d59bfb69abc2c723983a9c0aff943e29cb7a00;p=fba.git Continued: - count() > 0 or find() >= 0 ? --- diff --git a/fba/commands.py b/fba/commands.py index acb410c..3c244e2 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -285,7 +285,7 @@ def fetch_blocks(args: argparse.Namespace) -> int: if block["blocked"] == "": logger.warning("blocked is empty, blocker='%s'", blocker) continue - elif block["blocked"].count("*") >= 0: + elif block["blocked"].find("*") >= 0: logger.debug("blocker='%s' uses obfuscated domains, marking ...", blocker) instances.set_has_obfuscation(blocker, True) @@ -300,7 +300,7 @@ def fetch_blocks(args: argparse.Namespace) -> int: block["blocked"] = row[0] origin = row[1] nodeinfo_url = row[2] - elif block["blocked"].count("?") >= 0: + elif block["blocked"].find("?") >= 0: logger.debug("blocker='%s' uses obfuscated domains, marking ...", blocker) instances.set_has_obfuscation(blocker, True) diff --git a/fba/utils.py b/fba/utils.py index 441932f..79fb52f 100644 --- a/fba/utils.py +++ b/fba/utils.py @@ -189,7 +189,7 @@ def deobfuscate_domain(domain: str, blocker: str, domain_hash: str = None) -> st elif not isinstance(domain_hash, str) and domain_hash is not None: raise ValueError(f"Parameter domain_hash[]='{type(domain_hash)}' is not of type 'str'") - if domain.count("*") >= 0: + if domain.find("*") >= 0: logger.debug("blocker='%s' uses obfuscated domains, marking ...", blocker) instances.set_has_obfuscation(blocker, True) @@ -200,7 +200,7 @@ def deobfuscate_domain(domain: str, blocker: str, domain_hash: str = None) -> st if row is not None: logger.debug("domain='%s' de-obscured to '%s'", domain, row[0]) domain = row[0] - elif domain.count("?") >= 0: + elif domain.find("?") >= 0: logger.debug("blocker='%s' uses obfuscated domains, marking ...", blocker) instances.set_has_obfuscation(blocker, True)