summaryrefslogtreecommitdiff
path: root/searx/engines/duckduckgo_definitions.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/engines/duckduckgo_definitions.py')
-rw-r--r--searx/engines/duckduckgo_definitions.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/searx/engines/duckduckgo_definitions.py b/searx/engines/duckduckgo_definitions.py
index 3da7352a4..c008f22f7 100644
--- a/searx/engines/duckduckgo_definitions.py
+++ b/searx/engines/duckduckgo_definitions.py
@@ -116,15 +116,22 @@ def response(resp):
if len(heading)>0:
# TODO get infobox.meta.value where .label='article_title'
- results.append({
- 'infobox': heading,
- 'id': infobox_id,
- 'entity': entity,
- 'content': content,
- 'img_src' : image,
- 'attributes': attributes,
- 'urls': urls,
- 'relatedTopics': relatedTopics
- })
+ if image==None and len(attributes)==0 and len(urls)==1 and len(relatedTopics)==0 and len(content)==0:
+ results.append({
+ 'url': urls[0]['url'],
+ 'title': heading,
+ 'content': content
+ })
+ else:
+ results.append({
+ 'infobox': heading,
+ 'id': infobox_id,
+ 'entity': entity,
+ 'content': content,
+ 'img_src' : image,
+ 'attributes': attributes,
+ 'urls': urls,
+ 'relatedTopics': relatedTopics
+ })
return results