summaryrefslogtreecommitdiff
path: root/searx/engines/youtube_noapi.py
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2020-06-09 20:31:51 +0200
committerAdam Tauber <asciimoo@gmail.com>2020-06-09 20:31:51 +0200
commit6c062862513dcaeebeb497ba1c61ea83e3a9e50b (patch)
tree1a9e583f8de59ea5293dfd02b781d38b868bed2f /searx/engines/youtube_noapi.py
parent2c6531b2330a5c8ca986379dbad8812a6c6d3e49 (diff)
downloadsearxng-6c062862513dcaeebeb497ba1c61ea83e3a9e50b.tar.gz
searxng-6c062862513dcaeebeb497ba1c61ea83e3a9e50b.zip
[enh] add length and author details to youtube videos
closes #775
Diffstat (limited to 'searx/engines/youtube_noapi.py')
-rw-r--r--searx/engines/youtube_noapi.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/searx/engines/youtube_noapi.py b/searx/engines/youtube_noapi.py
index 49d0ae604..68a3739a2 100644
--- a/searx/engines/youtube_noapi.py
+++ b/searx/engines/youtube_noapi.py
@@ -70,11 +70,15 @@ def response(resp):
title = get_text_from_json(video.get('title', {}))
content = get_text_from_json(video.get('descriptionSnippet', {}))
embedded = embedded_url.format(videoid=videoid)
+ author = get_text_from_json(video.get('ownerText', {}))
+ length = get_text_from_json(video.get('lengthText', {}))
# append result
results.append({'url': url,
'title': title,
'content': content,
+ 'author': author,
+ 'length': length,
'template': 'videos.html',
'embedded': embedded,
'thumbnail': thumbnail})