diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2021-05-25 17:26:58 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2021-05-25 17:26:58 +0200 |
commit | dc21cb5d4baf463e3ede77dbf293bedc16de85b0 (patch) | |
tree | b2d4b1306e02f8c5f9dd15857f39503e1782fd3f /searx | |
parent | a88e3e4fea0e030bc70f79755df6f49ebc42be5b (diff) | |
download | searxng-dc21cb5d4baf463e3ede77dbf293bedc16de85b0.tar.gz searxng-dc21cb5d4baf463e3ede77dbf293bedc16de85b0.zip |
[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 <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rw-r--r-- | searx/engines/unsplash.py | 5 |
1 files 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 |