2"""This module holds the *data* created by::
7from __future__
import annotations
9__all__ = [
"ahmia_blacklist_loader"]
14from .core
import log, data_dir
15from .currencies
import CurrenciesDB
17CURRENCIES: CurrenciesDB
18USER_AGENTS: dict[str, typing.Any]
19EXTERNAL_URLS: dict[str, typing.Any]
20WIKIDATA_UNITS: dict[str, typing.Any]
21EXTERNAL_BANGS: dict[str, typing.Any]
22OSM_KEYS_TAGS: dict[str, typing.Any]
23ENGINE_DESCRIPTIONS: dict[str, typing.Any]
24ENGINE_TRAITS: dict[str, typing.Any]
25LOCALES: dict[str, typing.Any]
30 "EXTERNAL_URLS":
None,
31 "WIKIDATA_UNITS":
None,
32 "EXTERNAL_BANGS":
None,
33 "OSM_KEYS_TAGS":
None,
34 "ENGINE_DESCRIPTIONS":
None,
35 "ENGINE_TRAITS":
None,
40 "USER_AGENTS":
"useragents.json",
41 "EXTERNAL_URLS":
"external_urls.json",
42 "WIKIDATA_UNITS":
"wikidata_units.json",
43 "EXTERNAL_BANGS":
"external_bangs.json",
44 "OSM_KEYS_TAGS":
"osm_keys_tags.json",
45 "ENGINE_DESCRIPTIONS":
"engine_descriptions.json",
46 "ENGINE_TRAITS":
"engine_traits.json",
47 "LOCALES":
"locales.json",
53 if name
not in lazy_globals:
54 raise AttributeError(f
"module {__name__!r} has no attribute {name!r}")
56 data = lazy_globals[name]
60 log.debug(
"init searx.data.%s", name)
62 with open(data_dir / data_json_files[name], encoding=
'utf-8')
as f:
63 lazy_globals[name] = json.load(f)
65 return lazy_globals[name]
69 """Load data from `ahmia_blacklist.txt` and return a list of MD5 values of onion
70 names. The MD5 values are fetched by::
72 searxng_extra/update/update_ahmia_blacklist.py
74 This function is used by :py:mod:`searx.plugins.ahmia_filter`.
77 with open(data_dir /
'ahmia_blacklist.txt', encoding=
'utf-8')
as f:
78 return f.read().split()