From dc21cb5d4baf463e3ede77dbf293bedc16de85b0 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 25 May 2021 17:26:58 +0200 Subject: [PATCH] [fix] unsplash engine - 'searx:result: invalid title:' - Use result 'alt_description' as title, if not given use default title 'unknown'. - Use result 'description' from unsplash as 'content' Fix error:: DEBUG:searx:result: invalid title: {..., 'title': None, 'content': '', 'engine': 'unsplash'} Signed-off-by: Markus Heiser --- searx/engines/unsplash.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/searx/engines/unsplash.py b/searx/engines/unsplash.py index 95a80a47c..834bc917c 100644 --- a/searx/engines/unsplash.py +++ b/searx/engines/unsplash.py @@ -62,7 +62,8 @@ def response(resp): 'url': clean_url(result['links']['html']), 'thumbnail_src': clean_url(result['urls']['thumb']), 'img_src': clean_url(result['urls']['raw']), - 'title': result['description'], - 'content': '' + 'title': result.get('alt_description') or 'unknown', + 'content': result.get('description') or '' }) + return results