SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[fix] startpage autocompletion
Alexandre Flament3c3599c9e60d
diff --git a/searx/autocomplete.py b/searx/autocomplete.pyindex cf2deb62f..a55377cd9 100644--- a/searx/autocomplete.py+++ b/searx/autocomplete.py@@ -24,6 +24,7 @@ from httpx import HTTPErrorfrom searx import settings+from searx.data import ENGINES_LANGUAGESfrom searx.network import get as http_getfrom searx.exceptions import SearxEngineResponseException@@ -77,12 +78,11 @@ def google(query, lang):def startpage(query, lang):# startpage autocompleter- url = 'https://startpage.com/do/suggest?{query}'-- resp = get(url.format(query=urlencode({'query': query}))).text.split('\n')- if len(resp) > 1:- return resp- return []+ lui = ENGINES_LANGUAGES['startpage'].get(lang, 'english')+ url = 'https://startpage.com/suggestions?{query}'+ resp = get(url.format(query=urlencode({'q': query, 'segment': 'startpage.udog', 'lui': lui})))+ data = resp.json()+ return [e['text'] for e in data.get('suggestions', []) if 'text' in e]def swisscows(query, lang):