forked from Icycoide/searxng
[mod] templates: rename field for <iframe> URL to iframe_src
Rename result field data_src to iframe_src Suggested-by: @dalf https://github.com/searxng/searxng/pull/882#issuecomment-1037997402 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
f5e8cfade2
commit
7352c6bc79
17 changed files with 31 additions and 31 deletions
|
@ -4,7 +4,7 @@ Bandcamp (Music)
|
|||
@website https://bandcamp.com/
|
||||
@provide-api no
|
||||
@results HTML
|
||||
@parse url, title, content, publishedDate, data_src, thumbnail
|
||||
@parse url, title, content, publishedDate, iframe_src, thumbnail
|
||||
"""
|
||||
|
||||
from urllib.parse import urlencode, urlparse, parse_qs
|
||||
|
@ -27,7 +27,7 @@ paging = True
|
|||
|
||||
base_url = "https://bandcamp.com/"
|
||||
search_string = search_string = 'search?{query}&page={page}'
|
||||
data_src = "https://bandcamp.com/EmbeddedPlayer/{type}={result_id}/size=large/bgcol=ffffff/linkcol=0687f5/tracklist=false/artwork=small/transparent=true/"
|
||||
iframe_src = "https://bandcamp.com/EmbeddedPlayer/{type}={result_id}/size=large/bgcol=ffffff/linkcol=0687f5/tracklist=false/artwork=small/transparent=true/"
|
||||
|
||||
|
||||
def request(query, params):
|
||||
|
@ -71,9 +71,9 @@ def response(resp):
|
|||
if thumbnail:
|
||||
new_result['thumbnail'] = thumbnail[0]
|
||||
if "album" in result.classes:
|
||||
new_result["data_src"] = data_src.format(type='album', result_id=result_id)
|
||||
new_result["iframe_src"] = iframe_src.format(type='album', result_id=result_id)
|
||||
elif "track" in result.classes:
|
||||
new_result["data_src"] = data_src.format(type='track', result_id=result_id)
|
||||
new_result["iframe_src"] = iframe_src.format(type='track', result_id=result_id)
|
||||
|
||||
results.append(new_result)
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue