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
@@ -201,7 +201,7 @@ def parse_videos(data):
|
||||
for item in eval_xpath_list(dom, "//li[contains(@class, 'video_item')]"):
|
||||
url = eval_xpath_getindex(item, ".//a[contains(@class, 'info_title')]/@href", 0)
|
||||
|
||||
thumbnail = None
|
||||
thumbnail = ""
|
||||
try:
|
||||
thumbnail = eval_xpath_getindex(item, ".//img[contains(@class, 'thumb')]/@src", 0)
|
||||
except (ValueError, TypeError, SearxEngineXPathException):
|
||||
@@ -214,9 +214,8 @@ def parse_videos(data):
|
||||
pass
|
||||
|
||||
res.add(
|
||||
res.types.LegacyResult(
|
||||
template="videos.html",
|
||||
title=extract_text(eval_xpath(item, ".//a[contains(@class, 'info_title')]")),
|
||||
res.types.Video(
|
||||
title=extract_text(eval_xpath(item, ".//a[contains(@class, 'info_title')]")) or "",
|
||||
url=url,
|
||||
thumbnail=thumbnail,
|
||||
length=length,
|
||||
|
||||
Reference in New Issue
Block a user