summaryrefslogtreecommitdiff
path: root/searx/autocomplete.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-05-07 18:23:10 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2022-05-07 18:23:10 +0200
commit4326009d003f0c5cda518deeff0030903fbc7605 (patch)
tree98123244a625e5ff30232c4c83d06047bd856030 /searx/autocomplete.py
parent9ed6261308da1fafb0bda4c5bd5cf73c7b4c3444 (diff)
downloadsearxng-4326009d003f0c5cda518deeff0030903fbc7605.tar.gz
searxng-4326009d003f0c5cda518deeff0030903fbc7605.zip
[format.python] based on bugfix in 9ed626130
Diffstat (limited to 'searx/autocomplete.py')
-rw-r--r--searx/autocomplete.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/searx/autocomplete.py b/searx/autocomplete.py
index ff299d184..f2faa4538 100644
--- a/searx/autocomplete.py
+++ b/searx/autocomplete.py
@@ -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