mirror of
https://github.com/searxng/searxng.git
synced 2025-12-24 04:30:02 +00:00
[enh][mod] using image template rendering
This commit is contained in:
@@ -23,6 +23,8 @@ def response(resp):
|
||||
url = urljoin(base_url, result.attrib.get('href'))
|
||||
img = result.xpath('.//img')[0]
|
||||
title = img.attrib.get('alt', '')
|
||||
content = '<img src="%s" alt="%s" />' % (img.attrib.get('data-defer-src', ''), title)
|
||||
results.append({'url': url, 'title': title, 'content': content})
|
||||
img_src = img.attrib.get('data-defer-src')
|
||||
if not img_src:
|
||||
continue
|
||||
results.append({'url': url, 'title': title, 'img_src': img_src, 'template': 'images.html'})
|
||||
return results
|
||||
|
||||
Reference in New Issue
Block a user