summaryrefslogtreecommitdiff
path: root/searx/engines/peertube.py
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2024-07-20 21:27:12 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-07-27 11:49:58 +0200
commit304ddd8114e12f4fdd5057dc933a2981bd9e1ec7 (patch)
tree036c00c01e08e1dd1eb1a6ee136f88d8d5871848 /searx/engines/peertube.py
parent3f22dbb68ab1b1effa84048e15651c5b2e6aa160 (diff)
[feat] videos template: support for view count
Diffstat (limited to 'searx/engines/peertube.py')
-rw-r--r--searx/engines/peertube.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/searx/engines/peertube.py b/searx/engines/peertube.py
index 114e24c4f..0457c5d8d 100644
--- a/searx/engines/peertube.py
+++ b/searx/engines/peertube.py
@@ -14,7 +14,7 @@ import babel
from searx.network import get # see https://github.com/searxng/searxng/issues/762
from searx.locales import language_tag
-from searx.utils import html_to_text
+from searx.utils import html_to_text, humanize_number
from searx.enginelib.traits import EngineTraits
traits: EngineTraits
@@ -124,6 +124,7 @@ def video_response(resp):
'content': html_to_text(result.get('description') or ''),
'author': result.get('account', {}).get('displayName'),
'length': minute_to_hm(result.get('duration')),
+ 'views': humanize_number(result['views']),
'template': 'videos.html',
'publishedDate': parse(result['publishedAt']),
'iframe_src': result.get('embedUrl'),