]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 6 Nov 2023 03:02:06 +0000 (04:02 +0100)
committerRoland Häder <roland@mxchange.org>
Mon, 6 Nov 2023 03:02:06 +0000 (04:02 +0100)
- moved url list to fba/helpers/blocklists.py
- always update count of obfuscated domains

fba/commands.py
fba/helpers/blocklists.py

index 77de357827d259207efc23c03b1971f2e330accd..44ffb30a38b7e84329e93ebf3df9c3aa28d40362 100644 (file)
@@ -444,11 +444,10 @@ def fetch_blocks(args: argparse.Namespace) -> int:
             cookies.clear(block["blocked"])
 
         logger.info("blocker='%s' has %d obfuscated domain(s) and %d of them could be deobfuscated.", blocker, obfuscated, deobfuscated)
+        instances.set_obfuscated_blocks(blocker, obfuscated)
 
-        logger.debug("Checking if blocker='%s' has pending updates ...", blocker)
-        if instances.has_pending(blocker):
-            logger.debug("Flushing updates for blocker='%s' ...", blocker)
-            instances.update(blocker)
+        logger.debug("Flushing updates for blocker='%s' ...", blocker)
+        instances.update(blocker)
 
         logger.debug("Invoking commit() ...")
         database.connection.commit()
@@ -1059,14 +1058,8 @@ def fetch_txt(args: argparse.Namespace) -> int:
     logger.debug("Invoking locking.acquire() ...")
     locking.acquire()
 
-    # Static URLs
-    urls = ({
-        "blocker": "seirdy.one",
-        "url"    : "https://seirdy.one/pb/bsl.txt",
-    },)
-
-    logger.info("Checking %d text file(s) ...", len(urls))
-    for row in urls:
+    logger.info("Checking %d text file(s) ...", len(blocklists.txt_files))
+    for row in blocklists.txt_files:
         logger.debug("Fetching row[url]='%s' ...", row["url"])
         response = utils.fetch_url(row["url"], network.web_headers, (config.get("connection_timeout"), config.get("read_timeout")))
 
index 819d8a8af0593b38ffa6249cb7857f198e94cdf8..795fb252118325a962167ac81ba5248430de17d1 100644 (file)
@@ -75,12 +75,24 @@ oliphant_blocklists = (
     },
 )
 
+# Static URLs
+txt_files = ({
+    "blocker": "seirdy.one",
+    "url"    : "https://seirdy.one/pb/bsl.txt",
+},{
+    "blocker": "seirdy.one",
+    "url"    : "https://seirdy.one/pb/FediNuke.txt",
+})
+
 # Other CSV files
 csv_files = (
     {
         "blocker": "tooters.org",
         "csv_url": "https://raw.githubusercontent.com/victorwynne/victorwynne/tooters/federation/tooters_defederations.csv",
-    },
+    },{
+        "blocker": "pleroma.envs.net",
+        "csv_url": "https://seirdy.one/pb/pleroma.envs.net.csv",
+    }
 )
 
 def has(domain: str) -> bool: