mirror of
https://github.com/searxng/searxng.git
synced 2026-09-23 06:36:12 +00:00
[mod] migration of some engine results to the video class (#6743)
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
committed by
Markus Heiser
parent
ce48993997
commit
2e41cf7407
@@ -153,16 +153,13 @@ def response(resp: "SXNG_Response") -> EngineResults:
|
||||
length = result["video"].get("duration")
|
||||
|
||||
res.add(
|
||||
res.types.LegacyResult(
|
||||
{
|
||||
"template": "videos.html",
|
||||
"url": result["url"],
|
||||
"title": html_to_text(result["title"]),
|
||||
"content": html_to_text(result["description"]),
|
||||
"thumbnail": result.get("thumbnail", {}).get("original"),
|
||||
"length": length,
|
||||
"publishedDate": published_date,
|
||||
}
|
||||
res.types.Video(
|
||||
url=result["url"],
|
||||
title=html_to_text(result["title"]),
|
||||
content=html_to_text(result["description"]),
|
||||
thumbnail=result.get("thumbnail", {}).get("original"),
|
||||
length=length,
|
||||
publishedDate=published_date,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user