[feat] videos template: support for view count

This commit is contained in:
Bnyro 2024-07-20 21:27:12 +02:00 committed by Markus Heiser
parent 3f22dbb68a
commit 304ddd8114
6 changed files with 23 additions and 2 deletions

View file

@ -53,6 +53,8 @@ from urllib.parse import urlencode
import datetime
from dateutil import parser
from searx.utils import humanize_number
# about
about = {
"website": 'https://github.com/TeamPiped/Piped/',
@ -138,6 +140,7 @@ def response(resp):
"title": result.get("title", ""),
"publishedDate": parser.parse(time.ctime(uploaded / 1000)) if uploaded != -1 else None,
"iframe_src": _frontend_url() + '/embed' + result.get("url", ""),
"views": humanize_number(result["views"]),
}
length = result.get("duration")
if length: