summaryrefslogtreecommitdiff
path: root/searx/data/__init__.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2020-10-26 20:40:24 +0100
committerAlexandre Flament <alex@al-f.net>2020-10-27 20:00:04 +0100
commit5e7060053cc382723af5daa1b4af42fe228b5292 (patch)
treedf9a53dc57d1e389a08f6f1212ec1b50d6e21e42 /searx/data/__init__.py
parentdb703a0283ee169381aeea97c678e666ae508348 (diff)
downloadsearxng-5e7060053cc382723af5daa1b4af42fe228b5292.tar.gz
searxng-5e7060053cc382723af5daa1b4af42fe228b5292.zip
[mod] ahmia_filter.py: minor changes
- use result['parsed_url'] - load ahmia_blacklist.txt in searx.datae
Diffstat (limited to 'searx/data/__init__.py')
-rw-r--r--searx/data/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/searx/data/__init__.py b/searx/data/__init__.py
index 391947bff..1116e5d47 100644
--- a/searx/data/__init__.py
+++ b/searx/data/__init__.py
@@ -2,7 +2,7 @@ import json
from pathlib import Path
-__init__ = ['ENGINES_LANGUGAGES', 'CURRENCIES', 'USER_AGENTS', 'bangs_loader']
+__init__ = ['ENGINES_LANGUGAGES', 'CURRENCIES', 'USER_AGENTS', 'bangs_loader', 'ahmia_blacklist_loader']
data_dir = Path(__file__).parent
@@ -16,6 +16,11 @@ def bangs_loader():
return load('bangs.json')
+def ahmia_blacklist_loader():
+ with open(str(data_dir / 'ahmia_blacklist.txt'), encoding='utf-8') as fd:
+ return fd.read().split()
+
+
ENGINES_LANGUAGES = load('engines_languages.json')
CURRENCIES = load('currencies.json')
USER_AGENTS = load('useragents.json')