mirror of
https://github.com/searxng/searxng
synced 2024-01-01 18:24:07 +00:00
Merge pull request #2356 from dalf/fix-ddd
[fix] duckduckgo_definitions: fix relative image URL
This commit is contained in:
commit
a458451d20
@ -10,7 +10,7 @@ DuckDuckGo (definitions)
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode, urlparse, urljoin
|
||||||
from lxml import html
|
from lxml import html
|
||||||
|
|
||||||
from searx import logger
|
from searx import logger
|
||||||
@ -102,6 +102,8 @@ def response(resp):
|
|||||||
# image
|
# image
|
||||||
image = search_res.get('Image')
|
image = search_res.get('Image')
|
||||||
image = None if image == '' else image
|
image = None if image == '' else image
|
||||||
|
if image is not None and urlparse(image).netloc == '':
|
||||||
|
image = urljoin('https://duckduckgo.com', image)
|
||||||
|
|
||||||
# urls
|
# urls
|
||||||
# Official website, Wikipedia page
|
# Official website, Wikipedia page
|
||||||
|
Loading…
Reference in New Issue
Block a user