diff options
author | Alexandre Flament <alex@al-f.net> | 2023-09-09 10:18:39 +0000 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2023-09-09 13:02:36 +0200 |
commit | d07c006aed12631a7e0f9a5c82288a8ef7c5bfad (patch) | |
tree | 3d44039eb5302fc7db7d398f6ec92f03635142c3 /searx/engines | |
parent | 8e45ac42717da130017b53fd332afa416e36b194 (diff) | |
download | searxng-d07c006aed12631a7e0f9a5c82288a8ef7c5bfad.tar.gz searxng-d07c006aed12631a7e0f9a5c82288a8ef7c5bfad.zip |
Replace chompjs with pure Python code
The new implementation is good enough for the current usage (brave)
Diffstat (limited to 'searx/engines')
-rw-r--r-- | searx/engines/brave.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/engines/brave.py b/searx/engines/brave.py index d5e2d3e9f..e9d4af762 100644 --- a/searx/engines/brave.py +++ b/searx/engines/brave.py @@ -104,7 +104,6 @@ from urllib.parse import ( parse_qs, ) -import chompjs from lxml import html from searx import locales @@ -112,6 +111,7 @@ from searx.utils import ( extract_text, eval_xpath_list, eval_xpath_getindex, + js_variable_to_python, ) from searx.enginelib.traits import EngineTraits @@ -215,7 +215,7 @@ def response(resp): datastr = line.replace("const data = ", "").strip()[:-1] break - json_data = chompjs.parse_js_object(datastr) + json_data = js_variable_to_python(datastr) json_resp = json_data[1]['data']['body']['response'] if brave_category == 'news': |