From f3aa5ea47dd3fbe9fdebb7c1035b4e405fac333d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Sat, 6 Jan 2018 14:52:14 +0100 Subject: [PATCH] fix yacy result url Closes #1064 --- searx/engines/yacy.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/searx/engines/yacy.py b/searx/engines/yacy.py index c19140bb..7c307ce5 100644 --- a/searx/engines/yacy.py +++ b/searx/engines/yacy.py @@ -74,8 +74,17 @@ def response(resp): for result in search_results[0].get('items', []): # parse image results if result.get('image'): + + result_url = '' + if 'url' in result: + result_url = result['url'] + elif 'link' in result: + result_url = result['link'] + else: + continue + # append result - results.append({'url': result['url'], + results.append({'url': result_url, 'title': result['title'], 'content': '', 'img_src': result['image'],