summaryrefslogtreecommitdiff
path: root/searx/engines/brave.py
diff options
context:
space:
mode:
authorIvan Gabaldon <igabaldon@inetol.net>2025-11-06 10:09:10 +0100
committerGitHub <noreply@github.com>2025-11-06 10:09:10 +0100
commit7af922c9dfff6e60974eb2dfcb1399f4573820f4 (patch)
treefc717f4037f5d82e1fe59b9ff5cf31f77f15729d /searx/engines/brave.py
parentb1918dd12110c183fc1fba1c51778a32e6cb4049 (diff)
[enh] py: drop deps (#5407)
The difference between decompression with brotli or gzip in HTML files is negligible for 3 MB of compiled binary package. Introduced in https://github.com/searxng/searxng/commit/eaa694fb7d0e47b943bc6d6edb6cb6a40ab2d85e Closes https://github.com/searxng/searxng/security/code-scanning/276 Closes https://github.com/searxng/searxng/security/dependabot/37
Diffstat (limited to 'searx/engines/brave.py')
-rw-r--r--searx/engines/brave.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/searx/engines/brave.py b/searx/engines/brave.py
index c1148b889..fe8fb616b 100644
--- a/searx/engines/brave.py
+++ b/searx/engines/brave.py
@@ -198,9 +198,6 @@ time_range_map: dict[str, str] = {
def request(query: str, params: dict[str, t.Any]) -> None:
- # Don't accept br encoding / see https://github.com/searxng/searxng/pull/1787
- params['headers']['Accept-Encoding'] = 'gzip, deflate'
-
args: dict[str, t.Any] = {
'q': query,
'source': 'web',
@@ -436,14 +433,11 @@ def fetch_traits(engine_traits: EngineTraits):
engine_traits.custom["ui_lang"] = {}
- headers = {
- 'Accept-Encoding': 'gzip, deflate',
- }
lang_map = {'no': 'nb'} # norway
# languages (UI)
- resp = get('https://search.brave.com/settings', headers=headers)
+ resp = get('https://search.brave.com/settings')
if not resp.ok: # type: ignore
print("ERROR: response from Brave is not OK.")
@@ -472,7 +466,7 @@ def fetch_traits(engine_traits: EngineTraits):
# search regions of brave
- resp = get('https://cdn.search.brave.com/serp/v2/_app/immutable/chunks/parameters.734c106a.js', headers=headers)
+ resp = get('https://cdn.search.brave.com/serp/v2/_app/immutable/chunks/parameters.734c106a.js')
if not resp.ok: # type: ignore
print("ERROR: response from Brave is not OK.")