]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 30 Aug 2023 01:31:34 +0000 (03:31 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 30 Aug 2023 01:31:34 +0000 (03:31 +0200)
- need to check blacklist/is_wanted()-check first before invoking
  blocks.is_instance_blocked()

fba/commands.py

index 3fb4ea6869ded2a25451493b1172fd5db88889bf..df5bcb7e68f633654831407a7709575239cb55f4 100644 (file)
@@ -619,7 +619,13 @@ def fetch_todon_wiki(args: argparse.Namespace) -> int:
                     logger.warning("Exception '%s' during fetching instances (fetch_cs) from blocked='%s'", type(exception), blocked)
                     instances.set_last_error(blocked, exception)
 
-            if blocks.is_instance_blocked(blocker, blocked, block_level):
+            if not domain_helper.is_wanted(blocked):
+                logger.warning("blocked='%s' is not wanted - SKIPPED!", blocked)
+                continue
+            elif not domain_helper.is_wanted(blocker):
+                logger.warning("blocker='%s' is not wanted - SKIPPED!", blocker)
+                continue
+            elif blocks.is_instance_blocked(blocker, blocked, block_level):
                 logger.debug("blocked='%s',block_level='%s' is already blocked - SKIPPED!", blocked, block_level)
                 continue
 
@@ -1595,12 +1601,15 @@ def recheck_obfuscation(args: argparse.Namespace) -> int:
                 logger.debug("blocked='%s' was deobfuscated to blocked='%s'", block["blocked"], blocked)
                 obfuscated = obfuscated - 1
 
-                if blocks.is_instance_blocked(row["domain"], blocked):
-                    logger.debug("blocked='%s' is already blocked by domain='%s' - SKIPPED!", blocked, row["domain"])
-                    continue
-                elif blacklist.is_blacklisted(blocked):
+                if blacklist.is_blacklisted(blocked):
                     logger.debug("blocked='%s' is blacklisted - SKIPPED!", blocked)
                     continue
+                elif blacklist.is_blacklisted(row["domain"]):
+                    logger.debug("row[domain]='%s' is blacklisted - SKIPPED!", row["domain"])
+                    continue
+                elif blocks.is_instance_blocked(row["domain"], blocked):
+                    logger.debug("blocked='%s' is already blocked by domain='%s' - SKIPPED!", blocked, row["domain"])
+                    continue
 
                 block["block_level"] = blocks.alias_block_level(block["block_level"])