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] fix of PR #2225
Alexandre Flament5c6a5407a0b1
diff --git a/searx/search/__init__.py b/searx/search/__init__.pyindex 4511463f3..99459c7a3 100644--- a/searx/search/__init__.py+++ b/searx/search/__init__.py@@ -166,6 +166,9 @@ class Search:if request_params is None:continue+ with threading.RLock():+ processor.engine.stats['sent_search_count'] += 1+# append request to listrequests.append((engineref.name, self.search_query.query, request_params))diff --git a/searx/search/processors/online.py b/searx/search/processors/online.pyindex 17bbfef0f..b62f8059e 100644--- a/searx/search/processors/online.py+++ b/searx/search/processors/online.py@@ -19,15 +19,17 @@ from searx.search.processors.abstract import EngineProcessorlogger = logger.getChild('search.processor.online')-DEFAULT_PARAMS = {- 'method': 'GET',- 'headers': {},- 'data': {},- 'url': '',- 'cookies': {},- 'verify': True,- 'auth': None-}++def default_request_params():+ return {+ 'method': 'GET',+ 'headers': {},+ 'data': {},+ 'url': '',+ 'cookies': {},+ 'verify': True,+ 'auth': None+ }class OnlineProcessor(EngineProcessor):@@ -45,7 +47,7 @@ class OnlineProcessor(EngineProcessor):return None# add default params- params.update(DEFAULT_PARAMS)+ params.update(default_request_params())# add an user agentparams['headers']['User-Agent'] = gen_useragent()