[fix] presearch videos: item description and duration are located in metadata field

This commit is contained in:
Bnyro 2025-03-20 20:52:58 +01:00
parent 556db857aa
commit 1641d7d6ee
No known key found for this signature in database

View File

@ -264,14 +264,13 @@ def response(resp):
# a video and not to a video stream --> SearXNG can't use the video template.
for item in json_resp.get('videos', []):
metadata = [x for x in [item.get('description'), item.get('duration')] if x]
results.append(
{
'title': html_to_text(item['title']),
'url': item.get('link'),
'content': '',
'metadata': ' / '.join(metadata),
'content': item.get('description', ''),
'thumbnail': item.get('image'),
'length': item.get('duration'),
}
)