mirror of
https://github.com/searxng/searxng.git
synced 2026-09-25 15:46:06 +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
@@ -10,7 +10,7 @@ from datetime import datetime
|
||||
from urllib.parse import urlencode
|
||||
from urllib.parse import quote_plus
|
||||
|
||||
from searx.result_types import EngineResults, MainResult, LegacyResult, Image
|
||||
from searx.result_types import EngineResults, MainResult, Image, Video
|
||||
from searx.utils import html_to_text, gen_useragent, extr
|
||||
from searx.network import get # see https://github.com/searxng/searxng/issues/762
|
||||
|
||||
@@ -162,13 +162,11 @@ def _image_result(result):
|
||||
|
||||
|
||||
def _video_result(result):
|
||||
return LegacyResult(
|
||||
template='videos.html',
|
||||
return Video(
|
||||
url=result['content'],
|
||||
title=result['title'],
|
||||
content=result['description'],
|
||||
thumbnail=result['images'].get('small') or result['images'].get('medium'),
|
||||
source=result['provider'],
|
||||
length=result['duration'],
|
||||
metadata=result.get('uploader'),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user