]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Tue, 11 Jul 2023 08:24:04 +0000 (10:24 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 11 Jul 2023 08:24:04 +0000 (10:24 +0200)
- exclude chaos.social here as their API for fetching blocks is disabled and
  invoking set_total_blocks() would reset it to zero

fba/commands.py

index e6008ded4a73a744a0094bfdaf4eb88abc622baa..4d4f01f390bf335d6be7dc664941e06c53753a6f 100644 (file)
@@ -334,8 +334,10 @@ def fetch_blocks(args: argparse.Namespace) -> int:
         else:
             logger.warning("Unknown software: blocker='%s',software='%s'", blocker, software)
 
-        logger.debug("Invoking instances.set_total_blocks(%s, %d) ...", blocker, len(blocking))
-        instances.set_total_blocks(blocker, blocking)
+        logger.debug("blocker='%s'", blocker)
+        if blocker != "chaos.social":
+            logger.debug("Invoking instances.set_total_blocks(%s, %d) ...", blocker, len(blocking))
+            instances.set_total_blocks(blocker, blocking)
 
         logger.info("Checking %d entries from blocker='%s',software='%s' ...", len(blocking), blocker, software)
         blockdict = list()
@@ -685,8 +687,8 @@ def fetch_cs(args: argparse.Namespace):
     instances.set_total_blocks(blocker, blocking)
 
     logger.debug("blocklist[silenced]()=%d,blocklist[reject]()=%d", len(blocklist["silenced"]), len(blocklist["reject"]))
-    blockdict = list()
     if len(blocking) > 0:
+        blockdict = list()
         for block_level in blocklist:
             logger.info("block_level='%s' has %d row(s)", block_level, len(blocklist[block_level]))
 
@@ -1104,8 +1106,10 @@ def fetch_oliphant(args: argparse.Namespace) -> int:
             if reject_reports:
                 utils.process_block(block["blocker"], domain, None, "reject_reports")
 
-        logger.debug("Invoking instances.set_total_blocks(%s, domains()=%d) ...", block["blocker"], len(domains))
-        instances.set_total_blocks(block["blocker"], domains)
+        logger.debug("block[blocker]='%s'", block["blocker"])
+        if block["blocker"] != "chaos.social":
+            logger.debug("Invoking instances.set_total_blocks(%s, domains()=%d) ...", block["blocker"], len(domains))
+            instances.set_total_blocks(block["blocker"], domains)
 
         logger.debug("Checking if blocker='%s' has pending updates ...", block["blocker"])
         if instances.has_pending(block["blocker"]):
@@ -1444,8 +1448,10 @@ def recheck_obfuscation(args: argparse.Namespace) -> int:
         else:
             logger.warning("Unknown sofware: domain='%s',software='%s'", row["domain"], row["software"])
 
-        logger.debug("Invoking instances.set_total_blocks(%s, %d) ...", row["domain"], len(blocking))
-        instances.set_total_blocks(row["domain"], blocking)
+        logger.debug("row[domain]='%s'", row["domain"])
+        if row["domain"] != "chaos.social":
+            logger.debug("Invoking instances.set_total_blocks(%s, %d) ...", row["domain"], len(blocking))
+            instances.set_total_blocks(row["domain"], blocking)
 
         logger.info("Checking %d block(s) from domain='%s' ...", len(blocking), row["domain"])
         obfuscated = 0