diff options
Diffstat (limited to 'searx/autocomplete.py')
-rw-r--r-- | searx/autocomplete.py | 19 |
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 |