From d16942976b608f1970c734356e3c977da6849bd0 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 21 Oct 2021 12:17:26 +0100 Subject: [PATCH] cw lists can contain words and domains --- blocking.py | 13 ++++++++----- lists/murdoch.json | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/blocking.py b/blocking.py index da372f8af..3ae7f96f5 100644 --- a/blocking.py +++ b/blocking.py @@ -890,9 +890,12 @@ def loadLists(baseDir: str, verbose: bool) -> {}: listJson = loadJson(listFilename) if not listJson: continue - if listJson.get('name') and listJson.get('domains'): - name = listJson['name'] - if verbose: - print('List: ' + name) - result[name] = listJson + if not listJson.get('name'): + continue + if not listJson('words') and not listJson.get('domains'): + continue + name = listJson['name'] + if verbose: + print('List: ' + name) + result[name] = listJson return result diff --git a/lists/murdoch.json b/lists/murdoch.json index 44b2a406f..31c4a9d5c 100644 --- a/lists/murdoch.json +++ b/lists/murdoch.json @@ -1,6 +1,7 @@ { "name": "Murdoch press", "warning": "Murdoch Press", + "words": [], "domains": [ api.news, content.api.news,