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/plugins | |
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/plugins')
-rw-r--r-- | searx/plugins/hostname_replace.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/searx/plugins/hostname_replace.py b/searx/plugins/hostname_replace.py index e22b2dca0..acbc6304c 100644 --- a/searx/plugins/hostname_replace.py +++ b/searx/plugins/hostname_replace.py @@ -33,5 +33,10 @@ def on_result(request, search, result): if pattern.search(parsed_data_src.netloc): parsed_data_src = parsed_data_src._replace(netloc=pattern.sub(replacement, parsed_data_src.netloc)) result['data_src'] = urlunparse(parsed_data_src) + if result.get('audio_src', False): + parsed_audio_src = urlparse(result['audio_src']) + if pattern.search(parsed_audio_src.netloc): + parsed_audio_src = parsed_audio_src._replace(netloc=pattern.sub(replacement, parsed_audio_src.netloc)) + result['audio_src'] = urlunparse(parsed_audio_src) return True |