mirror of
https://github.com/searxng/searxng.git
synced 2025-02-28 17:56:48 +00:00
[fix] engine unsplash: image links by preserving URL parameters
Only remove ixid parameter while keeping other essential URL parameters to ensure images are properly displayed in search results.
This commit is contained in:
parent
cb0a75bad9
commit
bc5c8e5748
1 changed files with 2 additions and 2 deletions
|
@ -25,7 +25,7 @@ paging = True
|
|||
|
||||
def clean_url(url):
|
||||
parsed = urlparse(url)
|
||||
query = [(k, v) for (k, v) in parse_qsl(parsed.query) if k not in ['ixid', 's']]
|
||||
query = [(k, v) for (k, v) in parse_qsl(parsed.query) if k != 'ixid']
|
||||
|
||||
return urlunparse((parsed.scheme, parsed.netloc, parsed.path, parsed.params, urlencode(query), parsed.fragment))
|
||||
|
||||
|
@ -47,7 +47,7 @@ def response(resp):
|
|||
'template': 'images.html',
|
||||
'url': clean_url(result['links']['html']),
|
||||
'thumbnail_src': clean_url(result['urls']['thumb']),
|
||||
'img_src': clean_url(result['urls']['raw']),
|
||||
'img_src': clean_url(result['urls']['regular']),
|
||||
'title': result.get('alt_description') or 'unknown',
|
||||
'content': result.get('description') or '',
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue