@@ -6,8 +6,7 @@
66# @using-api yes
77# @results JSON
88# @stable yes
9−# @parse url, title, content, publishedDate, thumbnail, embedded
10−# @parse url, title, content, publishedDate, thumbnail, embedded, author
9+# @parse url, title, content, publishedDate, thumbnail, embedded, author, length
1110
1211from searx.url_utils import quote_plus
1312from dateutil import parser
@@ -85,12 +84,18 @@ def response(resp):
8584 publishedDate = parser.parse(
8685 time.ctime(result.get("published", 0))
8786 )
87+ length = time.gmtime(result.get("lengthSeconds"))
88+ if length.tm_hour:
89+ length = time.strftime("%H:%M:%S", length)
90+ else:
91+ length = time.strftime("%M:%S", length)
8892
8993 results.append(
9094 {
9195 "url": url,
9296 "title": result.get("title", ""),
9397 "content": result.get("description", ""),
98+ 'length': length,
9499 "template": "videos.html",
95100 "author": result.get("author"),
96101 "publishedDate": publishedDate,