[mod] result_templates/videos.html: replace embedded HTML by data_src

Embedded HTML breaks SearXNG architecture.  To modularize, HTML is generated in
the templates (oscar & simple) and result parameter 'embedded' is replaced by
'data_src', an URL for embedded content (<iframe>).

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2022-02-07 16:16:57 +01:00
parent a4942213a1
commit 46e131fdad
10 changed files with 23 additions and 66 deletions

View file

@ -51,12 +51,6 @@ def response(resp):
search_res = loads(resp.text)
embedded_url = (
'<iframe width="560" height="315" sandbox="allow-same-origin allow-scripts allow-popups" '
+ 'src="'
+ sanitized_url
+ '{embed_path}" frameborder="0" allowfullscreen></iframe>'
)
# return empty array if there are no results
if "data" not in search_res:
return []
@ -72,7 +66,6 @@ def response(resp):
content = ""
thumbnail = sanitized_url + res["thumbnailPath"]
publishedDate = datetime.strptime(res["publishedAt"], "%Y-%m-%dT%H:%M:%S.%fZ")
embedded = embedded_url.format(embed_path=res["embedPath"])
results.append(
{
@ -81,7 +74,7 @@ def response(resp):
"title": title,
"content": content,
"publishedDate": publishedDate,
"embedded": embedded,
"data_src": sanitized_url + res["embedPath"],
"thumbnail": thumbnail,
}
)