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] baidu captcha detection (#5111)
Zhijie He6b1516d6adc8
diff --git a/searx/engines/baidu.py b/searx/engines/baidu.pyindex 29c9c0e4d..57d1ed444 100644--- a/searx/engines/baidu.py+++ b/searx/engines/baidu.py@@ -13,7 +13,7 @@ from html import unescapeimport timeimport json-from searx.exceptions import SearxEngineAPIException+from searx.exceptions import SearxEngineAPIException, SearxEngineCaptchaExceptionfrom searx.utils import html_to_textabout = {@@ -89,10 +89,14 @@ def request(query, params):query_params["paramList"] += f",timestamp_range={past}-{now}"params["url"] = f"{query_url}?{urlencode(query_params)}"+ params["allow_redirects"] = Falsereturn paramsdef response(resp):+ # Detect Baidu Captcha, it will redirect to wappass.baidu.com+ if 'wappass.baidu.com/static/captcha' in resp.headers.get('Location', ''):+ raise SearxEngineCaptchaException()text = resp.textif baidu_category == 'images':