|
@@ -6,7 +6,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
+
|
|
|
|
|
|
from searx.url_utils import quote_plus
|
|
from searx.url_utils import quote_plus
|
|
from dateutil import parser
|
|
from dateutil import parser
|
|
@@ -84,13 +84,20 @@ def response(resp):
|
|
publishedDate = parser.parse(
|
|
publishedDate = parser.parse(
|
|
time.ctime(result.get("published", 0))
|
|
time.ctime(result.get("published", 0))
|
|
)
|
|
)
|
|
|
|
+ length = time.gmtime(result.get("lengthSeconds"))
|
|
|
|
+ if length.tm_hour:
|
|
|
|
+ length = time.strftime("%H:%M:%S", length)
|
|
|
|
+ else:
|
|
|
|
+ length = time.strftime("%M:%S", length)
|
|
|
|
|
|
results.append(
|
|
results.append(
|
|
{
|
|
{
|
|
"url": url,
|
|
"url": url,
|
|
"title": result.get("title", ""),
|
|
"title": result.get("title", ""),
|
|
"content": result.get("description", ""),
|
|
"content": result.get("description", ""),
|
|
|
|
+ 'length': length,
|
|
"template": "videos.html",
|
|
"template": "videos.html",
|
|
|
|
+ "author": result.get("author"),
|
|
"publishedDate": publishedDate,
|
|
"publishedDate": publishedDate,
|
|
"embedded": embedded,
|
|
"embedded": embedded,
|
|
"thumbnail": thumbnail,
|
|
"thumbnail": thumbnail,
|