.oO SearXNG Developer Documentation Oo.
|
Functions | |
request (query, params) | |
_extract_published_date (published_date_raw) | |
response (resp) | |
_parse_search (resp) | |
_parse_news (json_resp) | |
_parse_images (json_resp) | |
_parse_videos (json_resp) | |
fetch_traits (EngineTraits engine_traits) | |
Variables | |
logging | logger .Logger |
dict | about |
str | base_url = "https://search.brave.com/" |
list | categories = [] |
str | brave_category = 'search' |
Goggles = Any | |
bool | brave_spellcheck = False |
bool | send_accept_language_header = True |
bool | paging = False |
int | max_page = 10 |
bool | safesearch = True |
dict | safesearch_map = {2: 'strict', 1: 'moderate', 0: 'off'} |
bool | time_range_support = False |
dict | time_range_map |
Brave supports the categories listed in :py:obj:`brave_category` (General, news, videos, images). The support of :py:obj:`paging` and :py:obj:`time range <time_range_support>` is limited (see remarks). Configured ``brave`` engines: .. code:: yaml - name: brave engine: brave ... brave_category: search time_range_support: true paging: true - name: brave.images engine: brave ... brave_category: images - name: brave.videos engine: brave ... brave_category: videos - name: brave.news engine: brave ... brave_category: news - name: brave.goggles brave_category: goggles time_range_support: true paging: true ... brave_category: goggles .. _brave regions: Brave regions ============= Brave uses two-digit tags for the regions like ``ca`` while SearXNG deals with locales. To get a mapping, all *officiat de-facto* languages of the Brave region are mapped to regions in SearXNG (see :py:obj:`babel <babel.languages.get_official_languages>`): .. code:: python "regions": { .. "en-CA": "ca", "fr-CA": "ca", .. } .. note:: The language (aka region) support of Brave's index is limited to very basic languages. The search results for languages like Chinese or Arabic are of low quality. .. _brave googles: Brave Goggles ============= .. _list of Goggles: https://search.brave.com/goggles/discover .. _Goggles Whitepaper: https://brave.com/static-assets/files/goggles.pdf .. _Goggles Quickstart: https://github.com/brave/goggles-quickstart Goggles allow you to choose, alter, or extend the ranking of Brave Search results (`Goggles Whitepaper`_). Goggles are openly developed by the community of Brave Search users. Select from the `list of Goggles`_ people have published, or create your own (`Goggles Quickstart`_). .. _brave languages: Brave languages =============== Brave's language support is limited to the UI (menus, area local notations, etc). Brave's index only seems to support a locale, but it does not seem to support any languages in its index. The choice of available languages is very small (and its not clear to me where the difference in UI is when switching from en-us to en-ca or en-gb). In the :py:obj:`EngineTraits object <searx.enginelib.traits.EngineTraits>` the UI languages are stored in a custom field named ``ui_lang``: .. code:: python "custom": { "ui_lang": { "ca": "ca", "de-DE": "de-de", "en-CA": "en-ca", "en-GB": "en-gb", "en-US": "en-us", "es": "es", "fr-CA": "fr-ca", "fr-FR": "fr-fr", "ja-JP": "ja-jp", "pt-BR": "pt-br", "sq-AL": "sq-al" } }, Implementations ===============
|
protected |
Definition at line 241 of file brave.py.
Referenced by searx.engines.brave._parse_news(), searx.engines.brave._parse_search(), and searx.engines.brave._parse_videos().
|
protected |
Definition at line 348 of file brave.py.
Referenced by searx.engines.brave.response().
|
protected |
Definition at line 331 of file brave.py.
References searx.engines.brave._extract_published_date().
Referenced by searx.engines.brave.response().
|
protected |
Definition at line 272 of file brave.py.
References searx.engines.brave._extract_published_date().
Referenced by searx.engines.brave.response().
|
protected |
Definition at line 367 of file brave.py.
References searx.engines.brave._extract_published_date().
Referenced by searx.engines.brave.response().
searx.engines.brave.fetch_traits | ( | EngineTraits | engine_traits | ) |
Fetch :ref:`languages <brave languages>` and :ref:`regions <brave regions>` from Brave.
Definition at line 395 of file brave.py.
searx.engines.brave.request | ( | query, | |
params ) |
Definition at line 203 of file brave.py.
searx.engines.brave.response | ( | resp | ) |
Definition at line 251 of file brave.py.
References searx.engines.brave._parse_images(), searx.engines.brave._parse_news(), searx.engines.brave._parse_search(), and searx.engines.brave._parse_videos().
dict searx.engines.brave.about |
str searx.engines.brave.base_url = "https://search.brave.com/" |
dict searx.engines.brave.safesearch_map = {2: 'strict', 1: 'moderate', 0: 'off'} |
bool searx.engines.brave.send_accept_language_header = True |
dict searx.engines.brave.time_range_map |