summaryrefslogtreecommitdiff
path: root/searx/engines/freesound.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-02-07 21:59:21 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2022-02-13 14:20:47 +0100
commit98cab4cf754752e8a615b7b6c2685021592889a7 (patch)
tree8aac9568766473950db0747cd6a12e1b098384e5 /searx/engines/freesound.py
parentb9a2e8b387212d35cc83da50a07ee8fa47d2a56e (diff)
[mod] result_templates/default.html replace embedded HTML by data_src audio_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' (and 'audio_src'), an URL for embedded content (<iframe>). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/engines/freesound.py')
-rw-r--r--searx/engines/freesound.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/searx/engines/freesound.py b/searx/engines/freesound.py
index 121a6a5b0..ea6666621 100644
--- a/searx/engines/freesound.py
+++ b/searx/engines/freesound.py
@@ -29,9 +29,6 @@ search_url = (
url + "search/text/?query={query}&page={page}&fields=name,url,download,created,description,type&token={api_key}"
)
-embedded_url = '<audio controls><source src="{uri}" type="audio/{ftype}"></audio>'
-
-
# search request
def request(query, params):
params["url"] = search_url.format(
@@ -52,7 +49,6 @@ def response(resp):
content = result["description"][:128]
publishedDate = datetime.fromisoformat(result["created"])
uri = result["download"]
- embedded = embedded_url.format(uri=uri, ftype=result["type"])
# append result
results.append(
@@ -60,7 +56,7 @@ def response(resp):
"url": result["url"],
"title": title,
"publishedDate": publishedDate,
- "embedded": embedded,
+ "audio_src": uri,
"content": content,
}
)