forked from zaclys/searxng
5e7060053c
- use result['parsed_url'] - load ahmia_blacklist.txt in searx.datae
27 lines
650 B
Python
27 lines
650 B
Python
import json
|
|
from pathlib import Path
|
|
|
|
|
|
__init__ = ['ENGINES_LANGUGAGES', 'CURRENCIES', 'USER_AGENTS', 'bangs_loader', 'ahmia_blacklist_loader']
|
|
data_dir = Path(__file__).parent
|
|
|
|
|
|
def load(filename):
|
|
# add str(...) for Python 3.5
|
|
with open(str(data_dir / filename), encoding='utf-8') as fd:
|
|
return json.load(fd)
|
|
|
|
|
|
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')
|