mirror of
https://github.com/searxng/searxng.git
synced 2024-11-26 12:51:02 +00:00
[enh] thumbnails to youtube video results
This commit is contained in:
parent
ea03aaecb4
commit
831add33f0
1 changed files with 8 additions and 1 deletions
|
@ -28,7 +28,14 @@ def response(resp):
|
||||||
if url.endswith('&'):
|
if url.endswith('&'):
|
||||||
url = url[:-1]
|
url = url[:-1]
|
||||||
title = result['title']['$t']
|
title = result['title']['$t']
|
||||||
|
content = ''
|
||||||
|
if len(result['media$group']['media$thumbnail']):
|
||||||
|
content += '<img src="%s" />' % (result['media$group']['media$thumbnail'][0]['url'])
|
||||||
|
if len(content):
|
||||||
|
content += '<br />' + result['content']['$t']
|
||||||
|
else:
|
||||||
content = result['content']['$t']
|
content = result['content']['$t']
|
||||||
|
|
||||||
results.append({'url': url, 'title': title, 'content': content})
|
results.append({'url': url, 'title': title, 'content': content})
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
Loading…
Reference in a new issue