Browse Source

[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 <markus.heiser@darmarit.de>
Markus Heiser 3 years ago
parent
commit
e9588b70a6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      searx/autocomplete.py

+ 1 - 1
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