From 62b48e78c5c8a6e88f7303bf4c8927c1838746ed Mon Sep 17 00:00:00 2001 From: "Ivan K. Boikov" Date: Wed, 29 Jan 2025 15:21:09 +0100 Subject: Plugins --- searx/plugins/hostnames.py | 10 ++++++++++ searx/settings.yml | 27 +++++++++++++++++++++------ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/searx/plugins/hostnames.py b/searx/plugins/hostnames.py index a59496946..77a07526f 100644 --- a/searx/plugins/hostnames.py +++ b/searx/plugins/hostnames.py @@ -106,6 +106,16 @@ REMOVE: set = set() HIGH: set = set() LOW: set = set() +name = gettext('Hostnames plugin') +description = gettext('Rewrite hostnames, remove results or prioritize them based on the hostname') +default_on = True +preference_section = 'general' + +plugin_id = 'hostnames' + +parsed = 'parsed_url' +_url_fields = ['iframe_src', 'audio_src'] + class SXNGPlugin(Plugin): """Rewrite hostnames, remove results or prioritize them.""" diff --git a/searx/settings.yml b/searx/settings.yml index f99432a25..42cc0ce69 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -256,15 +256,30 @@ plugins: searx.plugins.tracker_url_remover.SXNGPlugin: active: true +# Comment or un-comment plugin to activate / deactivate by default. +# https://docs.searxng.org/admin/settings/settings_plugins.html +# +enabled_plugins: +# # these plugins are enabled if nothing is configured .. +# - 'Basic Calculator' + - 'Hash plugin' + - 'Self Information' + - 'Tracker URL remover' + - 'Unit converter plugin' +# - 'Ahmia blacklist' # activation depends on outgoing.using_tor_proxy +# # these plugins are disabled if nothing is configured .. + - 'Hostnames plugin' # see 'hostnames' configuration below + - 'Open Access DOI rewrite' +# - 'Tor check plugin' # Configuration of the "Hostnames plugin": # -# hostnames: -# replace: -# '(.*\.)?youtube\.com$': 'yt.example.com' -# '(.*\.)?youtu\.be$': 'yt.example.com' -# '(.*\.)?reddit\.com$': 'teddit.example.com' -# '(.*\.)?redd\.it$': 'teddit.example.com' +hostnames: + replace: +# '(.*\.)?youtube\.com$': 'invidious.example.com' +# '(.*\.)?youtu\.be$': 'invidious.example.com' + '(.*\.)?reddit\.com$': 'old.reddit.com' + '(.*\.)?redd\.it$': 'old.reddit.com' # '(www\.)?twitter\.com$': 'nitter.example.com' # remove: # - '(.*\.)?facebook.com$' -- cgit v1.2.3