.oO SearXNG Developer Documentation Oo.
|
Functions | |
bool | is_vpn_connected (html.HtmlElement dom) |
dict | assign_headers (dict headers) |
request (str query, dict params) | |
extract_result (list[html.HtmlElement] dom_result) | |
extract_results (html.HtmlElement search_results) | |
response (Response resp) | |
fetch_traits (EngineTraits engine_traits) | |
Variables | |
logger = logging.getLogger() | |
bool | use_cache = True |
str | leta_engine = 'google' |
str | search_url = "https://leta.mullvad.net" |
dict | about |
list | categories = ['general', 'web'] |
bool | paging = True |
int | max_page = 50 |
bool | time_range_support = True |
dict | time_range_dict |
list | available_leta_engines |
This is the implementation of the Mullvad-Leta meta-search engine. This engine **REQUIRES** that searxng operate within a Mullvad VPN If using docker, consider using gluetun for easily connecting to the Mullvad - https://github.com/qdm12/gluetun Otherwise, follow instructions provided by Mullvad for enabling the VPN on Linux - https://mullvad.net/en/help/install-mullvad-app-linux .. hint:: The :py:obj:`EngineTraits` is empty by default. Maintainers have to run ``make data.traits`` (in the Mullvad VPN / :py:obj:`fetch_traits`) and rebase the modified JSON file ``searx/data/engine_traits.json`` on every single update of SearXNG!
dict searx.engines.mullvad_leta.assign_headers | ( | dict | headers | ) |
Assigns the headers to make a request to Mullvad Leta
Definition at line 80 of file mullvad_leta.py.
Referenced by searx.engines.mullvad_leta.fetch_traits(), and searx.engines.mullvad_leta.request().
searx.engines.mullvad_leta.extract_result | ( | list[html.HtmlElement] | dom_result | ) |
Definition at line 130 of file mullvad_leta.py.
Referenced by searx.engines.mullvad_leta.extract_results().
searx.engines.mullvad_leta.extract_results | ( | html.HtmlElement | search_results | ) |
Definition at line 146 of file mullvad_leta.py.
References searx.engines.mullvad_leta.extract_result().
Referenced by searx.engines.mullvad_leta.response().
searx.engines.mullvad_leta.fetch_traits | ( | EngineTraits | engine_traits | ) |
Fetch languages and regions from Mullvad-Leta .. warning:: Fetching the engine traits also requires a Mullvad VPN connection. If not connected, then an error message will print and no traits will be updated.
Definition at line 165 of file mullvad_leta.py.
References searx.engines.mullvad_leta.assign_headers(), and searx.engines.mullvad_leta.is_vpn_connected().
bool searx.engines.mullvad_leta.is_vpn_connected | ( | html.HtmlElement | dom | ) |
Returns true if the VPN is connected, False otherwise
Definition at line 74 of file mullvad_leta.py.
Referenced by searx.engines.mullvad_leta.fetch_traits(), and searx.engines.mullvad_leta.response().
searx.engines.mullvad_leta.request | ( | str | query, |
dict | params ) |
Definition at line 89 of file mullvad_leta.py.
References searx.engines.mullvad_leta.assign_headers().
searx.engines.mullvad_leta.response | ( | Response | resp | ) |
Checks if connected to Mullvad VPN, then extracts the search results from the DOM resp: requests response object
Definition at line 154 of file mullvad_leta.py.
References searx.engines.mullvad_leta.extract_results(), and searx.engines.mullvad_leta.is_vpn_connected().
dict searx.engines.mullvad_leta.about |
Definition at line 47 of file mullvad_leta.py.
list searx.engines.mullvad_leta.available_leta_engines |
Definition at line 68 of file mullvad_leta.py.
list searx.engines.mullvad_leta.categories = ['general', 'web'] |
Definition at line 57 of file mullvad_leta.py.
str searx.engines.mullvad_leta.leta_engine = 'google' |
Definition at line 42 of file mullvad_leta.py.
searx.engines.mullvad_leta.logger = logging.getLogger() |
Definition at line 36 of file mullvad_leta.py.
int searx.engines.mullvad_leta.max_page = 50 |
Definition at line 59 of file mullvad_leta.py.
bool searx.engines.mullvad_leta.paging = True |
Definition at line 58 of file mullvad_leta.py.
str searx.engines.mullvad_leta.search_url = "https://leta.mullvad.net" |
Definition at line 44 of file mullvad_leta.py.
dict searx.engines.mullvad_leta.time_range_dict |
Definition at line 61 of file mullvad_leta.py.
bool searx.engines.mullvad_leta.time_range_support = True |
Definition at line 60 of file mullvad_leta.py.
bool searx.engines.mullvad_leta.use_cache = True |
Definition at line 40 of file mullvad_leta.py.