diff options
author | Alexandre Flament <alex@al-f.net> | 2020-12-07 10:16:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 10:16:53 +0100 |
commit | a458451d20bf45baf62d79a1e4ea2151e176f1d4 (patch) | |
tree | 7a1c9842e00abd116685355fa2fdd6bc034e81ff /searx | |
parent | 925bb561a2797b6d3cc5be748c2361721b8e1f08 (diff) | |
parent | 28cc644f0ae4c9cbbdb372522633b68f25eca1a4 (diff) | |
download | searxng-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.py | 4 |
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 |