summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorNoémi Ványi <sitbackandwait@gmail.com>2018-01-06 14:52:14 +0100
committerNoémi Ványi <sitbackandwait@gmail.com>2018-01-06 14:52:14 +0100
commitf3aa5ea47dd3fbe9fdebb7c1035b4e405fac333d (patch)
tree986f420ea6df747dfa6ae3492a18a594914e712a /searx
parente3033393709bce1070e2779d8fde6bc9626e5f16 (diff)
downloadsearxng-f3aa5ea47dd3fbe9fdebb7c1035b4e405fac333d.tar.gz
searxng-f3aa5ea47dd3fbe9fdebb7c1035b4e405fac333d.zip
fix yacy result url
Closes #1064
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/yacy.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/searx/engines/yacy.py b/searx/engines/yacy.py
index c19140bb0..7c307ce53 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'],