summaryrefslogtreecommitdiff
path: root/searx/autocomplete.py
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2026-07-07 20:52:07 +0200
committerBnyro <bnyro@tutanota.com>2026-07-08 20:48:15 +0200
commitda6a230413a41e7b751414684d06c219d775d7b5 (patch)
treeae685f18641e666818adae0d7c1af2cbcdbfe5f9 /searx/autocomplete.py
parentf69b22c45cf156dd935db583550d2134077435d1 (diff)
[fix] autocomplete: google autocompleter crashes
`engines` only contains active engines. Since `google` was set to inactive, it's no longer part of the , making the engine crash. With this workaround, we directly load the engine traits from the data dictionary instead of going the intermediate step with the Google engine.
Diffstat (limited to 'searx/autocomplete.py')
-rw-r--r--searx/autocomplete.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/searx/autocomplete.py b/searx/autocomplete.py
index 4e66dff22..9e0c0d84f 100644
--- a/searx/autocomplete.py
+++ b/searx/autocomplete.py
@@ -21,6 +21,8 @@ from searx.engines import (
from searx.network import get as http_get, post as http_post
from searx.exceptions import SearxEngineResponseException
from searx.utils import extr, gen_useragent
+from searx.data import ENGINE_TRAITS
+from searx.enginelib.traits import EngineTraits
if t.TYPE_CHECKING:
from searx.extended_types import SXNG_Response
@@ -133,7 +135,9 @@ def google_complete(query: str, sxng_locale: str) -> list[str]:
"""
- google_info: dict[str, t.Any] = google.get_google_info({'searxng_locale': sxng_locale}, engines['google'].traits)
+ data = ENGINE_TRAITS.get("google") or {}
+ traits = EngineTraits(**data)
+ google_info: dict[str, t.Any] = google.get_google_info({'searxng_locale': sxng_locale}, traits)
url = 'https://{subdomain}/complete/search?{args}'
args = urlencode(
{