summaryrefslogtreecommitdiff
path: root/searx/engines/piped.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/piped.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/piped.py')
-rw-r--r--searx/engines/piped.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/searx/engines/piped.py b/searx/engines/piped.py
index 34f0910ba..564753494 100644
--- a/searx/engines/piped.py
+++ b/searx/engines/piped.py
@@ -12,7 +12,9 @@ Configuration
=============
The :py:obj:`backend_url` and :py:obj:`frontend_url` has to be set in the engine
-named `piped` and are used by all piped engines
+named `piped` and are used by all ``piped`` engines (unless an individual values
+for ``backend_url`` and ``frontend_url`` are configured for the engine).
+
.. code:: yaml
@@ -43,6 +45,7 @@ fit into SearXNG's UI to select a page by number.
Implementations
===============
+
"""
@@ -69,7 +72,7 @@ categories = []
paging = True
# search-url
-backend_url: list | str = "https://pipedapi.kavin.rocks"
+backend_url: list[str] | str | None = None
"""Piped-Backend_: The core component behind Piped. The value is an URL or a
list of URLs. In the latter case instance will be selected randomly. For a
complete list of official instances see Piped-Instances (`JSON
@@ -80,7 +83,7 @@ complete list of official instances see Piped-Instances (`JSON
"""
-frontend_url: str = "https://piped.video"
+frontend_url: str | None = None
"""Piped-Frontend_: URL to use as link and for embeds.
.. _Piped-Frontend: https://github.com/TeamPiped/Piped
@@ -93,7 +96,7 @@ piped_filter = 'all'
def _backend_url() -> str:
from searx.engines import engines # pylint: disable=import-outside-toplevel
- url = engines['piped'].backend_url # type: ignore
+ url: list[str] | str = backend_url or engines["piped"].backend_url # type: ignore
if isinstance(url, list):
url = random.choice(url)
return url
@@ -102,7 +105,7 @@ def _backend_url() -> str:
def _frontend_url() -> str:
from searx.engines import engines # pylint: disable=import-outside-toplevel
- return engines['piped'].frontend_url # type: ignore
+ return frontend_url or engines["piped"].frontend_url # type: ignore
def request(query, params):