]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Tue, 27 Jun 2023 03:17:18 +0000 (05:17 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 27 Jun 2023 03:17:18 +0000 (05:17 +0200)
- count() > 0 or find() >= 0 ?

fba/commands.py
fba/utils.py

index acb410c108fae9cc97fc2209787a5cb89f95d094..3c244e2a999f83473ce223c102299c9d1d1d3e1c 100644 (file)
@@ -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)
 
index 441932f7234fc91db67c539c1263b0a28c2ba156..79fb52f1c480e5730332347a66114af7aa8b0877 100644 (file)
@@ -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)