summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2020-12-07 10:16:53 +0100
committerGitHub <noreply@github.com>2020-12-07 10:16:53 +0100
commita458451d20bf45baf62d79a1e4ea2151e176f1d4 (patch)
tree7a1c9842e00abd116685355fa2fdd6bc034e81ff /searx
parent925bb561a2797b6d3cc5be748c2361721b8e1f08 (diff)
parent28cc644f0ae4c9cbbdb372522633b68f25eca1a4 (diff)
downloadsearxng-a458451d20bf45baf62d79a1e4ea2151e176f1d4.tar.gz
searxng-a458451d20bf45baf62d79a1e4ea2151e176f1d4.zip
Merge pull request #2356 from dalf/fix-ddd
[fix] duckduckgo_definitions: fix relative image URL
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/duckduckgo_definitions.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/searx/engines/duckduckgo_definitions.py b/searx/engines/duckduckgo_definitions.py
index 5a7649173..1d1c84b4b 100644
--- a/searx/engines/duckduckgo_definitions.py
+++ b/searx/engines/duckduckgo_definitions.py
@@ -10,7 +10,7 @@ DuckDuckGo (definitions)
"""
import json
-from urllib.parse import urlencode
+from urllib.parse import urlencode, urlparse, urljoin
from lxml import html
from searx import logger
@@ -102,6 +102,8 @@ def response(resp):
# image
image = search_res.get('Image')
image = None if image == '' else image
+ if image is not None and urlparse(image).netloc == '':
+ image = urljoin('https://duckduckgo.com', image)
# urls
# Official website, Wikipedia page