diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2022-02-07 16:16:57 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2022-02-13 14:20:47 +0100 |
commit | 46e131fdadd94910c0e258aa4e855ad8019edbf7 (patch) | |
tree | 3e4de6dae4274331631bfefb3e3446e13bc9c022 /searx/engines/dailymotion.py | |
parent | a4942213a1dc6404616e239e0d2fb55a6e19a499 (diff) | |
download | searxng-46e131fdadd94910c0e258aa4e855ad8019edbf7.tar.gz searxng-46e131fdadd94910c0e258aa4e855ad8019edbf7.zip |
[mod] result_templates/videos.html: replace embedded HTML by data_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', an URL for embedded content (<iframe>).
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/engines/dailymotion.py')
-rw-r--r-- | searx/engines/dailymotion.py | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/searx/engines/dailymotion.py b/searx/engines/dailymotion.py index 5607691a4..1a080feda 100644 --- a/searx/engines/dailymotion.py +++ b/searx/engines/dailymotion.py @@ -25,11 +25,6 @@ paging = True # search-url # see http://www.dailymotion.com/doc/api/obj-video.html search_url = 'https://api.dailymotion.com/videos?fields=created_time,title,description,duration,url,thumbnail_360_url,id&sort=relevance&limit=5&page={pageno}&{query}' # noqa -embedded_url = ( - '<iframe frameborder="0" width="540" height="304" ' - + 'data-src="https://www.dailymotion.com/embed/video/{videoid}" allowfullscreen></iframe>' -) - supported_languages_url = 'https://api.dailymotion.com/languages' @@ -64,7 +59,6 @@ def response(resp): content = html_to_text(res['description']) thumbnail = res['thumbnail_360_url'] publishedDate = datetime.fromtimestamp(res['created_time'], None) - embedded = embedded_url.format(videoid=res['id']) # http to https thumbnail = thumbnail.replace("http://", "https://") @@ -76,7 +70,7 @@ def response(resp): 'title': title, 'content': content, 'publishedDate': publishedDate, - 'embedded': embedded, + 'data_src': "https://www.dailymotion.com/embed/video/" + res['id'], 'thumbnail': thumbnail, } ) |