From 98badc9cd0cfd00405014f843de7dd883d75ecca Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Thu, 22 May 2025 17:43:11 +0200 Subject: [PATCH] [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 --- searx/engines/zlibrary.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/searx/engines/zlibrary.py b/searx/engines/zlibrary.py index c9acb28fe..6357232af 100644 --- a/searx/engines/zlibrary.py +++ b/searx/engines/zlibrary.py @@ -180,6 +180,8 @@ def fetch_traits(engine_traits: EngineTraits) -> None: # pylint: disable=import-outside-toplevel, too-many-branches import babel + import httpx + from searx.network import get # see https://github.com/searxng/searxng/issues/762 from searx.locales import language_tag @@ -191,7 +193,7 @@ def fetch_traits(engine_traits: EngineTraits) -> None: try: 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" --> {exc}") _use_old_values()