SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[fix] minor type hint issues (#5459)
Markus Heiserb299386d3e67
diff --git a/searx/extended_types.py b/searx/extended_types.pyindex 059ad947e..1dbe4ea87 100644--- a/searx/extended_types.py+++ b/searx/extended_types.py@@ -30,7 +30,7 @@ import httpxif typing.TYPE_CHECKING:import searx.preferencesimport searx.results- from searx.search.processors import ParamTypes+ from searx.search.processors import OnlineParamTypesclass SXNG_Request(flask.Request):@@ -83,4 +83,4 @@ class SXNG_Response(httpx.Response):"""ok: bool- search_params: "ParamTypes"+ search_params: "OnlineParamTypes"diff --git a/searx/search/processors/online.py b/searx/search/processors/online.pyindex 23bb7fda0..8592457d3 100644--- a/searx/search/processors/online.py+++ b/searx/search/processors/online.py@@ -35,7 +35,7 @@ class HTTPParams(t.TypedDict):headers: dict[str, str]"""HTTP header information."""- data: dict[str, str]+ data: dict[str, str | int | dict[str, str | int]]"""Sending `form encoded data`_... _form encoded data:@@ -56,7 +56,7 @@ class HTTPParams(t.TypedDict):https://www.python-httpx.org/quickstart/#sending-json-encoded-data"""- url: str+ url: str | None"""Requested url."""cookies: dict[str, str]@@ -200,7 +200,7 @@ class OnlineProcessor(EngineProcessor):request_args["content"] = params["content"]# send the request- response = req(params["url"], **request_args)+ response = req(params["url"], **request_args) # pyright: ignore[reportArgumentType]# check soft limit of the redirect countif len(response.history) > soft_max_redirects:diff --git a/searx/utils.py b/searx/utils.pyindex 7e2f4d78f..3d7d6e715 100644--- a/searx/utils.py+++ b/searx/utils.py@@ -741,7 +741,7 @@ def detect_language(text: str, threshold: float = 0.3, only_search_languages: boreturn None-def js_variable_to_python(js_variable: str) -> str:+def js_variable_to_python(js_variable: str) -> t.Any:"""Convert a javascript variable into JSON and then load the valueIt does not deal with all cases, but it is good enough for now.@@ -808,7 +808,7 @@ def js_variable_to_python(js_variable: str) -> str:# replace the surogate character by colons = s.replace(chr(1), ':')# load the JSON and return the result- return json.loads(s) # pyright: ignore[reportAny]+ return json.loads(s)def parse_duration_string(duration_str: str) -> timedelta | None: