mirror of
https://github.com/searxng/searxng.git
synced 2025-07-13 00:09:18 +02:00
[fix] autocomplete: remove broken startpage backend
as long we don't have a solution for #4334 we can't offer startpage as autocomplete backend. Related: - https://github.com/searxng/searxng/issues/4334 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
1ae37728e4
commit
cc9dbde2e5
3 changed files with 13 additions and 24 deletions
|
@ -183,15 +183,6 @@ def stract(query, _lang):
|
|||
return [html.unescape(suggestion['raw']) for suggestion in resp.json()]
|
||||
|
||||
|
||||
def startpage(query, sxng_locale):
|
||||
"""Autocomplete from Startpage. Supports Startpage's languages"""
|
||||
lui = engines['startpage'].traits.get_language(sxng_locale, '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):
|
||||
# swisscows autocompleter
|
||||
url = 'https://swisscows.ch/api/suggest?{query}&itemsCount=5'
|
||||
|
@ -263,7 +254,6 @@ backends = {
|
|||
'mwmbl': mwmbl,
|
||||
'qwant': qwant,
|
||||
'seznam': seznam,
|
||||
'startpage': startpage,
|
||||
'stract': stract,
|
||||
'swisscows': swisscows,
|
||||
'wikipedia': wikipedia,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue