summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-02-13 16:12:46 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2022-02-18 19:00:49 +0100
commit7352c6bc79dacd501d3059e4e3995e9acf4ce456 (patch)
tree42b89f82a598914e18df0d69acde1a45adabc7b4 /searx
parentf5e8cfade200fb7b7b2aace255d90c72dcc5bc37 (diff)
downloadsearxng-7352c6bc79dacd501d3059e4e3995e9acf4ce456.tar.gz
searxng-7352c6bc79dacd501d3059e4e3995e9acf4ce456.zip
[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>
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/bandcamp.py8
-rw-r--r--searx/engines/dailymotion.py2
-rw-r--r--searx/engines/deezer.py4
-rw-r--r--searx/engines/invidious.py2
-rw-r--r--searx/engines/mixcloud.py4
-rw-r--r--searx/engines/peertube.py2
-rw-r--r--searx/engines/sepiasearch.py2
-rw-r--r--searx/engines/soundcloud.py2
-rw-r--r--searx/engines/spotify.py2
-rw-r--r--searx/engines/vimeo.py2
-rw-r--r--searx/engines/youtube_api.py2
-rw-r--r--searx/engines/youtube_noapi.py4
-rw-r--r--searx/plugins/hostname_replace.py2
-rw-r--r--searx/templates/oscar/result_templates/default.html6
-rw-r--r--searx/templates/oscar/result_templates/videos.html6
-rw-r--r--searx/templates/simple/result_templates/default.html6
-rw-r--r--searx/templates/simple/result_templates/videos.html6
17 files changed, 31 insertions, 31 deletions
diff --git a/searx/engines/bandcamp.py b/searx/engines/bandcamp.py
index bc3ecaf96..f868b44ed 100644
--- a/searx/engines/bandcamp.py
+++ b/searx/engines/bandcamp.py
@@ -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
diff --git a/searx/engines/dailymotion.py b/searx/engines/dailymotion.py
index 1a080feda..d71cdc114 100644
--- a/searx/engines/dailymotion.py
+++ b/searx/engines/dailymotion.py
@@ -70,7 +70,7 @@ def response(resp):
'title': title,
'content': content,
'publishedDate': publishedDate,
- 'data_src': "https://www.dailymotion.com/embed/video/" + res['id'],
+ 'iframe_src': "https://www.dailymotion.com/embed/video/" + res['id'],
'thumbnail': thumbnail,
}
)
diff --git a/searx/engines/deezer.py b/searx/engines/deezer.py
index 6e884b498..63c71e3cc 100644
--- a/searx/engines/deezer.py
+++ b/searx/engines/deezer.py
@@ -23,7 +23,7 @@ paging = True
# search-url
url = 'https://api.deezer.com/'
search_url = url + 'search?{query}&index={offset}'
-data_src = "https://www.deezer.com/plugins/player?type=tracks&id={audioid}"
+iframe_src = "https://www.deezer.com/plugins/player?type=tracks&id={audioid}"
# do search-request
def request(query, params):
@@ -53,7 +53,7 @@ def response(resp):
# append result
results.append(
- {'url': url, 'title': title, 'data_src': data_src.format(audioid=result['id']), 'content': content}
+ {'url': url, 'title': title, 'iframe_src': iframe_src.format(audioid=result['id']), 'content': content}
)
# return results
diff --git a/searx/engines/invidious.py b/searx/engines/invidious.py
index f9944f6b3..29f276636 100644
--- a/searx/engines/invidious.py
+++ b/searx/engines/invidious.py
@@ -91,7 +91,7 @@ def response(resp):
"template": "videos.html",
"author": result.get("author"),
"publishedDate": publishedDate,
- "data_src": resp.search_params['base_url'] + '/embed/' + videoid,
+ "iframe_src": resp.search_params['base_url'] + '/embed/' + videoid,
"thumbnail": thumbnail,
}
)
diff --git a/searx/engines/mixcloud.py b/searx/engines/mixcloud.py
index 41d39b753..af5126304 100644
--- a/searx/engines/mixcloud.py
+++ b/searx/engines/mixcloud.py
@@ -24,7 +24,7 @@ paging = True
# search-url
url = 'https://api.mixcloud.com/'
search_url = url + 'search/?{query}&type=cloudcast&limit=10&offset={offset}'
-data_src = "https://www.mixcloud.com/widget/iframe/?feed={url}"
+iframe_src = "https://www.mixcloud.com/widget/iframe/?feed={url}"
# do search-request
def request(query, params):
@@ -53,7 +53,7 @@ def response(resp):
{
'url': url,
'title': title,
- 'data_src': data_src.format(url=url),
+ 'iframe_src': iframe_src.format(url=url),
'publishedDate': publishedDate,
'content': content,
}
diff --git a/searx/engines/peertube.py b/searx/engines/peertube.py
index 343c2a02c..089775694 100644
--- a/searx/engines/peertube.py
+++ b/searx/engines/peertube.py
@@ -74,7 +74,7 @@ def response(resp):
"title": title,
"content": content,
"publishedDate": publishedDate,
- "data_src": sanitized_url + res["embedPath"],
+ "iframe_src": sanitized_url + res["embedPath"],
"thumbnail": thumbnail,
}
)
diff --git a/searx/engines/sepiasearch.py b/searx/engines/sepiasearch.py
index 291277b1f..9c45d6c43 100644
--- a/searx/engines/sepiasearch.py
+++ b/searx/engines/sepiasearch.py
@@ -98,7 +98,7 @@ def response(resp):
'length': length,
'template': 'videos.html',
'publishedDate': publishedDate,
- 'data_src': result.get('embedUrl'),
+ 'iframe_src': result.get('embedUrl'),
'thumbnail': thumbnail,
}
)
diff --git a/searx/engines/soundcloud.py b/searx/engines/soundcloud.py
index 918b56448..e189c5d8e 100644
--- a/searx/engines/soundcloud.py
+++ b/searx/engines/soundcloud.py
@@ -98,7 +98,7 @@ def response(resp):
'url': result['permalink_url'],
'title': title,
'publishedDate': publishedDate,
- 'data_src': "https://w.soundcloud.com/player/?url=" + uri,
+ 'iframe_src': "https://w.soundcloud.com/player/?url=" + uri,
'content': content,
}
)
diff --git a/searx/engines/spotify.py b/searx/engines/spotify.py
index c287a3469..87edb7f1b 100644
--- a/searx/engines/spotify.py
+++ b/searx/engines/spotify.py
@@ -67,7 +67,7 @@ def response(resp):
{
'url': url,
'title': title,
- 'data_src': "https://embed.spotify.com/?uri=spotify:track:" + result['id'],
+ 'iframe_src': "https://embed.spotify.com/?uri=spotify:track:" + result['id'],
'content': content,
}
)
diff --git a/searx/engines/vimeo.py b/searx/engines/vimeo.py
index 42cc4eecc..2449345e6 100644
--- a/searx/engines/vimeo.py
+++ b/searx/engines/vimeo.py
@@ -57,7 +57,7 @@ def response(resp):
'content': '',
'template': 'videos.html',
'publishedDate': publishedDate,
- 'data_src': "https://player.vimeo.com/video/" + videoid,
+ 'iframe_src': "https://player.vimeo.com/video/" + videoid,
'thumbnail': thumbnail,
}
)
diff --git a/searx/engines/youtube_api.py b/searx/engines/youtube_api.py
index 6c46ca90c..1b332a9f7 100644
--- a/searx/engines/youtube_api.py
+++ b/searx/engines/youtube_api.py
@@ -78,7 +78,7 @@ def response(resp):
'content': content,
'template': 'videos.html',
'publishedDate': publishedDate,
- 'data_src': "https://www.youtube-nocookie.com/embed/" + videoid,
+ 'iframe_src': "https://www.youtube-nocookie.com/embed/" + videoid,
'thumbnail': thumbnail,
}
)
diff --git a/searx/engines/youtube_noapi.py b/searx/engines/youtube_noapi.py
index dff8e0a52..406314684 100644
--- a/searx/engines/youtube_noapi.py
+++ b/searx/engines/youtube_noapi.py
@@ -85,7 +85,7 @@ def parse_next_page_response(response_text):
'author': section['ownerText']['runs'][0]['text'],
'length': section['lengthText']['simpleText'],
'template': 'videos.html',
- 'data_src': 'https://www.youtube-nocookie.com/embed/' + section['videoId'],
+ 'iframe_src': 'https://www.youtube-nocookie.com/embed/' + section['videoId'],
'thumbnail': section['thumbnail']['thumbnails'][-1]['url'],
}
)
@@ -156,7 +156,7 @@ def parse_first_page_response(response_text):
'author': author,
'length': length,
'template': 'videos.html',
- 'data_src': 'https://www.youtube-nocookie.com/embed/' + videoid,
+ 'iframe_src': 'https://www.youtube-nocookie.com/embed/' + videoid,
'thumbnail': thumbnail,
}
)
diff --git a/searx/plugins/hostname_replace.py b/searx/plugins/hostname_replace.py
index 51bd003b1..039aadb91 100644
--- a/searx/plugins/hostname_replace.py
+++ b/searx/plugins/hostname_replace.py
@@ -17,7 +17,7 @@ replacements = {re.compile(p): r for (p, r) in settings[plugin_id].items()} if p
logger = logger.getChild(plugin_id)
parsed = 'parsed_url'
-_url_fields = ['data_src', 'audio_src']
+_url_fields = ['iframe_src', 'audio_src']
def on_result(request, search, result):
diff --git a/searx/templates/oscar/result_templates/default.html b/searx/templates/oscar/result_templates/default.html
index 5517b7b9c..ea202910d 100644
--- a/searx/templates/oscar/result_templates/default.html
+++ b/searx/templates/oscar/result_templates/default.html
@@ -3,13 +3,13 @@
{{- result_header(result, favicons, loop.index) -}}
{{- result_sub_header(result, loop.index) -}}
-{%- if result.data_src -%}
+{%- if result.iframe_src -%}
<small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}" aria-labelledby="result-{{loop.index}}">{{ icon('music') }} {{ _('show media') }}</a></small>
{%- endif -%}
-{% if result.data_src -%}
+{% if result.iframe_src -%}
<div id="result-media-{{ index }}" class="embedded-content invisible">
- <iframe data-src="{{result.data_src}}" frameborder="0" scrolling="no" allowfullscreen></iframe>
+ <iframe data-src="{{result.iframe_src}}" frameborder="0" scrolling="no" allowfullscreen></iframe>
</div>
{%- endif -%}
diff --git a/searx/templates/oscar/result_templates/videos.html b/searx/templates/oscar/result_templates/videos.html
index 4519b96d6..975f75e2a 100644
--- a/searx/templates/oscar/result_templates/videos.html
+++ b/searx/templates/oscar/result_templates/videos.html
@@ -3,13 +3,13 @@
{{- result_header(result, favicons, loop.index) -}}
{{- result_sub_header(result, loop.index) -}}
-{%- if result.data_src -%}
+{%- if result.iframe_src -%}
<small> &bull; <a class="text-info btn-collapse collapsed cursor-pointer media-loader disabled_if_nojs" data-toggle="collapse" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}" aria-labelledby="result-{{loop.index}}">{{ icon('film') }} {{ _('show video') }}</a></small>
{%- endif -%}
-{% if result.data_src -%}
+{% if result.iframe_src -%}
<div id="result-video-{{ index }}" class="embedded-video collapse">
- <iframe data-src="{{result.data_src}}" width="540" height="304" frameborder="0" scrolling="no" allowfullscreen></iframe>
+ <iframe data-src="{{result.iframe_src}}" width="540" height="304" frameborder="0" scrolling="no" allowfullscreen></iframe>
</div>
{%- endif %}
diff --git a/searx/templates/simple/result_templates/default.html b/searx/templates/simple/result_templates/default.html
index 9e4dae138..0033e845b 100644
--- a/searx/templates/simple/result_templates/default.html
+++ b/searx/templates/simple/result_templates/default.html
@@ -2,7 +2,7 @@
{{ result_header(result, favicons, image_proxify) -}}
{{- result_sub_header(result) -}}
-{% if result.data_src -%}
+{% if result.iframe_src -%}
<p class="altlink"> &bull; <a class="btn-collapse collapsed media-loader disabled_if_nojs" data-target="#result-media-{{ index }}" data-btn-text-collapsed="{{ _('show media') }}" data-btn-text-not-collapsed="{{ _('hide media') }}">{{ icon('music-note') }} {{ _('show media') }}</a></p>
{%- endif %}
{%- if result.content %}
@@ -15,9 +15,9 @@
</p>
{% endif -%}
{{- result_sub_footer(result, proxify) -}}
-{% if result.data_src -%}
+{% if result.iframe_src -%}
<div id="result-media-{{ index }}" class="embedded-content invisible">
- <iframe data-src="{{result.data_src}}" frameborder="0" allowfullscreen></iframe>
+ <iframe data-src="{{result.iframe_src}}" frameborder="0" allowfullscreen></iframe>
</div>
{%- endif %}
{% if result.audio_src -%}
diff --git a/searx/templates/simple/result_templates/videos.html b/searx/templates/simple/result_templates/videos.html
index 6da70a8a2..adbda4063 100644
--- a/searx/templates/simple/result_templates/videos.html
+++ b/searx/templates/simple/result_templates/videos.html
@@ -2,7 +2,7 @@
{{ result_header(result, favicons, image_proxify) }}
{{ result_sub_header(result) }}
-{% if result.data_src -%}
+{% if result.iframe_src -%}
<p class="altlink"> &bull; <a class="btn-collapse collapsed media-loader disabled_if_nojs" data-target="#result-video-{{ index }}" data-btn-text-collapsed="{{ _('show video') }}" data-btn-text-not-collapsed="{{ _('hide video') }}">{{ icon('film-outline') }} {{ _('show video') }}</a></p>
{%- endif %}
{%- if result.content %}
@@ -16,9 +16,9 @@
{% endif -%}
</p>
{{- result_sub_footer(result, proxify) -}}
-{% if result.data_src -%}
+{% if result.iframe_src -%}
<div id="result-video-{{ index }}" class="embedded-video invisible">
- <iframe data-src="{{result.data_src}}" frameborder="0" allowfullscreen></iframe>
+ <iframe data-src="{{result.iframe_src}}" frameborder="0" allowfullscreen></iframe>
</div>
{%- endif %}
{{ result_footer(result) }}