From e9588b70a6304afb8ac1de73479d7ade1e01b155 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 23 Jan 2022 17:22:13 +0100 Subject: [PATCH] [fix] brave autocompleter: charset_normalizer issues Use httpx.Response.json() to avoid charset_normalizer issues: DEBUG charset_normalizer : override steps (5) and chunk_size (512) as content does not fit (153 byte(s) given) parameters. INFO charset_normalizer : ascii passed initial chaos probing. Mean measured chaos is 0.000000 % DEBUG charset_normalizer : ascii should target any language(s) of ['Latin Based'] INFO charset_normalizer : ascii is most likely the one. Stopping the process. [1] https://www.python-httpx.org/api/#response Signed-off-by: Markus Heiser --- searx/autocomplete.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/autocomplete.py b/searx/autocomplete.py index 00ec98bbc..8a67f8139 100644 --- a/searx/autocomplete.py +++ b/searx/autocomplete.py @@ -39,7 +39,7 @@ def brave(query, _lang): results = [] if resp.ok: - data = loads(resp.text) + data = resp.json() for item in data[1]: results.append(item) return results