forked from Icycoide/searxng
[enh][mod] using image template rendering
This commit is contained in:
parent
31471ed936
commit
3a6d3e3377
3 changed files with 8 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue