[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>
This commit is contained in:
Markus Heiser 2022-02-07 21:59:21 +01:00
parent b9a2e8b387
commit 98cab4cf75
10 changed files with 62 additions and 53 deletions

View file

@ -37,12 +37,6 @@ search_url = (
'&client_id={client_id}'
) # noqa
embedded_url = (
'<iframe width="100%" height="166" '
+ 'scrolling="no" frameborder="no" '
+ 'data-src="https://w.soundcloud.com/player/?url={uri}"></iframe>'
)
cid_re = re.compile(r'client_id:"([^"]*)"', re.I | re.U)
guest_client_id = ''
@ -97,7 +91,6 @@ def response(resp):
content = result['description'] or ''
publishedDate = parser.parse(result['last_modified'])
uri = quote_plus(result['uri'])
embedded = embedded_url.format(uri=uri)
# append result
results.append(
@ -105,7 +98,7 @@ def response(resp):
'url': result['permalink_url'],
'title': title,
'publishedDate': publishedDate,
'embedded': embedded,
'data_src': "https://w.soundcloud.com/player/?url=" + uri,
'content': content,
}
)