summaryrefslogtreecommitdiff
path: root/searx/engines/yacy.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarIT.de>2025-09-10 12:57:36 +0200
committerGitHub <noreply@github.com>2025-09-10 12:57:36 +0200
commita9b088d832021271c872a29675abd2887dbdcf65 (patch)
treec72b9fb2a7c71aad970384e4e9862184a4bd9791 /searx/engines/yacy.py
parent97ed5ef9f1d0b74c64ea287b4b5ed131b5502f4c (diff)
[feat] engines yacy & piped: enable individual configuration of URLs (#5195)
With this change it is possible with individual engines (yacy & piped) to configure individual URLs. Related: - https://github.com/searxng/searxng/issues/4869#issuecomment-327335928 - https://github.com/searxng/searxng/pull/3472/files#r1595586019 - https://github.com/searxng/searxng/issues/3428#issuecomment-2102142530 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/engines/yacy.py')
-rw-r--r--searx/engines/yacy.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/searx/engines/yacy.py b/searx/engines/yacy.py
index fbd96e333..e8ba1292a 100644
--- a/searx/engines/yacy.py
+++ b/searx/engines/yacy.py
@@ -23,7 +23,8 @@ The engine has the following (additional) settings:
- :py:obj:`search_type`
The :py:obj:`base_url` has to be set in the engine named `yacy` and is used by
-all yacy engines.
+all yacy engines (unless an individual value for ``base_url`` is configured for
+the engine).
.. code:: yaml
@@ -95,7 +96,7 @@ search_type = 'text'
``video`` are not yet implemented (Pull-Requests are welcome).
"""
-base_url: list | str = 'https://yacy.searchlab.eu'
+base_url: list[str] | str | None = None
"""The value is an URL or a list of URLs. In the latter case instance will be
selected randomly.
"""
@@ -114,7 +115,7 @@ def init(_):
def _base_url() -> str:
from searx.engines import engines # pylint: disable=import-outside-toplevel
- url = engines['yacy'].base_url # type: ignore
+ url: list[str] | str = base_url or engines["yacy"].base_url # type: ignore
if isinstance(url, list):
url = random.choice(url)
if url.endswith("/"):