[fix] searx.data: fetch-traits - z-library (httpx.ConnectError) (#4835)

There is currently no known z-library, and all known URLs are dead [1]. To avoid
interrupting automated updates, a connection error to a z-library is treated as
a *known error*, and the old properties of the z-library are retained.

[1] https://github.com/searxng/searxng/issues/3610

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2025-05-22 17:43:11 +02:00 committed by GitHub
parent d29cf64ce4
commit 98badc9cd0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -180,6 +180,8 @@ def fetch_traits(engine_traits: EngineTraits) -> None:
# pylint: disable=import-outside-toplevel, too-many-branches # pylint: disable=import-outside-toplevel, too-many-branches
import babel import babel
import httpx
from searx.network import get # see https://github.com/searxng/searxng/issues/762 from searx.network import get # see https://github.com/searxng/searxng/issues/762
from searx.locales import language_tag from searx.locales import language_tag
@ -191,7 +193,7 @@ def fetch_traits(engine_traits: EngineTraits) -> None:
try: try:
resp = get(base_url, verify=False) resp = get(base_url, verify=False)
except SearxException as exc: except (SearxException, httpx.ConnectError) as exc:
print(f"ERROR: zlibrary domain '{base_url}' is seized?") print(f"ERROR: zlibrary domain '{base_url}' is seized?")
print(f" --> {exc}") print(f" --> {exc}")
_use_old_values() _use_old_values()