mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 13:49:26 +02:00
[format.python] based on bugfix in 9ed626130
This commit is contained in:
parent
9ed6261308
commit
4326009d00
5 changed files with 40 additions and 36 deletions
|
@ -89,17 +89,24 @@ def seznam(query, _lang):
|
|||
# seznam search autocompleter
|
||||
url = 'https://suggest.seznam.cz/fulltext/cs?{query}'
|
||||
|
||||
resp = get(url.format(query=urlencode(
|
||||
{'phrase': query, 'cursorPosition': len(query), 'format': 'json-2', 'highlight': '1', 'count': '6'}
|
||||
)))
|
||||
resp = get(
|
||||
url.format(
|
||||
query=urlencode(
|
||||
{'phrase': query, 'cursorPosition': len(query), 'format': 'json-2', 'highlight': '1', 'count': '6'}
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if not resp.ok:
|
||||
return []
|
||||
|
||||
data = resp.json()
|
||||
return [''.join(
|
||||
[part.get('text', '') for part in item.get('text', [])]
|
||||
) for item in data.get('result', []) if item.get('itemType', None) == 'ItemType.TEXT']
|
||||
return [
|
||||
''.join([part.get('text', '') for part in item.get('text', [])])
|
||||
for item in data.get('result', [])
|
||||
if item.get('itemType', None) == 'ItemType.TEXT'
|
||||
]
|
||||
|
||||
|
||||
def startpage(query, lang):
|
||||
# startpage autocompleter
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue