summaryrefslogtreecommitdiff
path: root/searx/engines/deezer.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/deezer.py
parentb9a2e8b387212d35cc83da50a07ee8fa47d2a56e (diff)
downloadsearxng-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/deezer.py')
-rw-r--r--searx/engines/deezer.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/searx/engines/deezer.py b/searx/engines/deezer.py
index 220ac599d..6e884b498 100644
--- a/searx/engines/deezer.py
+++ b/searx/engines/deezer.py
@@ -23,13 +23,7 @@ paging = True
# search-url
url = 'https://api.deezer.com/'
search_url = url + 'search?{query}&index={offset}'
-
-embedded_url = (
- '<iframe scrolling="no" frameborder="0" allowTransparency="true" '
- + 'data-src="https://www.deezer.com/plugins/player?type=tracks&id={audioid}" '
- + 'width="540" height="80"></iframe>'
-)
-
+data_src = "https://www.deezer.com/plugins/player?type=tracks&id={audioid}"
# do search-request
def request(query, params):
@@ -57,10 +51,10 @@ def response(resp):
content = '{} - {} - {}'.format(result['artist']['name'], result['album']['title'], result['title'])
- embedded = embedded_url.format(audioid=result['id'])
-
# append result
- results.append({'url': url, 'title': title, 'embedded': embedded, 'content': content})
+ results.append(
+ {'url': url, 'title': title, 'data_src': data_src.format(audioid=result['id']), 'content': content}
+ )
# return results
return results