mirror of
https://github.com/searxng/searxng.git
synced 2025-09-10 20:28:25 +02:00
[mod] add utils/fetch_external_bangs.py
Based on duckduckgo bangs Store bangs on a trie to allow autocomplete (not in this commit)
This commit is contained in:
parent
606aa79e49
commit
7c1847d5f2
7 changed files with 19432 additions and 67946 deletions
|
@ -2,7 +2,7 @@ import json
|
|||
from pathlib import Path
|
||||
|
||||
|
||||
__init__ = ['ENGINES_LANGUGAGES', 'CURRENCIES', 'USER_AGENTS', 'EXTERNAL_URLS', 'WIKIDATA_UNITS',
|
||||
__init__ = ['ENGINES_LANGUGAGES', 'CURRENCIES', 'USER_AGENTS', 'EXTERNAL_URLS', 'WIKIDATA_UNITS', 'EXTERNAL_BANGS',
|
||||
'bangs_loader', 'ahmia_blacklist_loader']
|
||||
data_dir = Path(__file__).parent
|
||||
|
||||
|
@ -12,10 +12,6 @@ def load(filename):
|
|||
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()
|
||||
|
@ -26,3 +22,4 @@ CURRENCIES = load('currencies.json')
|
|||
USER_AGENTS = load('useragents.json')
|
||||
EXTERNAL_URLS = load('external_urls.json')
|
||||
WIKIDATA_UNITS = load('wikidata_units.json')
|
||||
EXTERNAL_BANGS = load('external_bangs.json')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue