summaryrefslogtreecommitdiff
path: root/searx/plugins/hostname_replace.py
AgeCommit message (Collapse)Author
2022-02-18[mod] templates: rename field for <iframe> URL to iframe_srcMarkus Heiser
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>
2022-02-18[fix] hostname_replace.py: don't stop replace URL in fieldsMarkus Heiser
This is a rewrite of the hostname_replace.py that: - don't stop to replace URL in fields ('data_src', 'audio_src') if there isn't a 'parsed_url', - adds a comment about keep or remove a result from the result list - adds a loop over ['data_src', 'audio_src'] instead of doubling code lines Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2022-02-13[mod] result_templates/default.html replace embedded HTML by data_src audio_srcMarkus Heiser
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>
2022-02-13[mod] hostname_replace: replace hostnames in result's data_src paramMarkus Heiser
To test you need to redirect embeded videos (e.g.) from youtube to a invidios instance. Search for videos using engine `!youtube lebowski`. The result URLs and the embeded videos should link to the invidios instance. Here is an example of such a `hostname_replace` configuration:: hostname_replace: # youtube --> Invidious '(.*\.)?youtube-nocookie\.com': 'invidio.xamh.de' '(.*\.)?youtube\.com$': 'invidio.xamh.de' '(.*\.)?invidious\.snopyta\.org$': 'invidio.xamh.de' '(.*\.)?vid\.puffyan\.us': 'invidio.xamh.de' '(.*\.)?invidious\.kavin\.rocks$': 'invidio.xamh.de' '(.*\.)?inv\.riverside\.rocks$': 'invidio.xamh.de' Closes: https://github.com/searxng/searxng/issues/873 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2021-09-11[enh] add hostname_replace pluginAlexandre Flament
* backport of https://github.com/searx/searx/pull/2724 * allow to remove result if the replacement is the boolean value false