From: Roland Häder Date: Mon, 6 Nov 2023 03:02:06 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cc695476f2cb49c887578737b027a493e12b04be;p=fba.git Continued: - moved url list to fba/helpers/blocklists.py - always update count of obfuscated domains --- diff --git a/fba/commands.py b/fba/commands.py index 77de357..44ffb30 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -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"))) diff --git a/fba/helpers/blocklists.py b/fba/helpers/blocklists.py index 819d8a8..795fb25 100644 --- a/fba/helpers/blocklists.py +++ b/fba/helpers/blocklists.py @@ -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: