summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2026-07-14 20:27:30 +0200
committerBnyro <bnyro@tutanota.com>2026-07-14 20:32:18 +0200
commit7fa9f162258cf747ee8ac92a6c1b7b83ca8a5007 (patch)
treea633a9966ecb5ddc6ab82374646307a85e4845c6
parent9e25585aecd9f6ab1fdf30922da64fd91eb25425 (diff)
[fix] heexy: blocked by cloudflare
-rw-r--r--searx/engines/heexy.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/engines/heexy.py b/searx/engines/heexy.py
index 1eadfb477..73abc44b3 100644
--- a/searx/engines/heexy.py
+++ b/searx/engines/heexy.py
@@ -68,7 +68,9 @@ def _get_api_token(query: str) -> str:
if cached_token:
return cached_token
- resp = get(f"{base_url}/search?q={query}", headers={"User-Agent": gen_useragent()})
+ resp = get(
+ f"{base_url}/search?q={query}", headers={"User-Agent": gen_useragent(), "Accept-Language": "en-US,en:q=0.9"}
+ )
if not resp.ok:
raise SearxEngineAPIException("failed to obtain request token: invalid response code")
@@ -76,7 +78,7 @@ def _get_api_token(query: str) -> str:
if not token:
raise SearxEngineAPIException("failed to obtain request token: no token found")
- CACHE.set("token", token)
+ CACHE.set("token", token, expire=3 * 60)
return token