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] resulthunter: detect blocked requests instead of returning 0 results
Bnyro28b61729c7bc
diff --git a/searx/engines/resulthunter.py b/searx/engines/resulthunter.pyindex 5ebda3e7e..ee0384bad 100644--- a/searx/engines/resulthunter.py+++ b/searx/engines/resulthunter.py@@ -10,6 +10,7 @@ from urllib.parse import urlencodefrom lxml import htmlfrom searx import locales+from searx.exceptions import SearxEngineResponseExceptionfrom searx.result_types import EngineResultsfrom searx.utils import eval_xpath_list, eval_xpath, extract_text@@ -112,6 +113,11 @@ def _image_results(doc: "ElementBase") -> EngineResults:def response(resp: "SXNG_Response") -> EngineResults:doc = html.fromstring(resp.text)+ # if the request was wrong (e.g. missing params), the site doesn't contain a result container+ # and instead shows an "Installation required" page to download the resulthunter browser extension+ if not eval_xpath(doc, "//div[contains(@class, 'organic-results-container')]"):+ raise SearxEngineResponseException()+match resulthunter_categ:case "web":return _general_results(doc)