summaryrefslogtreecommitdiff
path: root/searx/engines/peertube.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-02-07 16:16:57 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2022-02-13 14:20:47 +0100
commit46e131fdadd94910c0e258aa4e855ad8019edbf7 (patch)
tree3e4de6dae4274331631bfefb3e3446e13bc9c022 /searx/engines/peertube.py
parenta4942213a1dc6404616e239e0d2fb55a6e19a499 (diff)
[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>
Diffstat (limited to 'searx/engines/peertube.py')
-rw-r--r--searx/engines/peertube.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/searx/engines/peertube.py b/searx/engines/peertube.py
index 1ace14027..343c2a02c 100644
--- a/searx/engines/peertube.py
+++ b/searx/engines/peertube.py
@@ -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,
}
)