diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2022-02-07 21:59:21 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2022-02-13 14:20:47 +0100 |
commit | 98cab4cf754752e8a615b7b6c2685021592889a7 (patch) | |
tree | 8aac9568766473950db0747cd6a12e1b098384e5 /searx/engines/mixcloud.py | |
parent | b9a2e8b387212d35cc83da50a07ee8fa47d2a56e (diff) | |
download | searxng-98cab4cf754752e8a615b7b6c2685021592889a7.tar.gz searxng-98cab4cf754752e8a615b7b6c2685021592889a7.zip |
[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/mixcloud.py')
-rw-r--r-- | searx/engines/mixcloud.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/searx/engines/mixcloud.py b/searx/engines/mixcloud.py index f5e0f55fc..41d39b753 100644 --- a/searx/engines/mixcloud.py +++ b/searx/engines/mixcloud.py @@ -24,12 +24,7 @@ paging = True # search-url url = 'https://api.mixcloud.com/' search_url = url + 'search/?{query}&type=cloudcast&limit=10&offset={offset}' - -embedded_url = ( - '<iframe scrolling="no" frameborder="0" allowTransparency="true" ' - + 'data-src="https://www.mixcloud.com/widget/iframe/?feed={url}" width="300" height="300"></iframe>' -) - +data_src = "https://www.mixcloud.com/widget/iframe/?feed={url}" # do search-request def request(query, params): @@ -51,12 +46,17 @@ def response(resp): title = result['name'] url = result['url'] content = result['user']['name'] - embedded = embedded_url.format(url=url) publishedDate = parser.parse(result['created_time']) # append result results.append( - {'url': url, 'title': title, 'embedded': embedded, 'publishedDate': publishedDate, 'content': content} + { + 'url': url, + 'title': title, + 'data_src': data_src.format(url=url), + 'publishedDate': publishedDate, + 'content': content, + } ) # return results |