mirror of https://github.com/searx/searx
[fix] fix of PR #2225
This commit is contained in:
parent
9b27935f71
commit
5c6a5407a0
|
@ -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 list
|
||||
requests.append((engineref.name, self.search_query.query, request_params))
|
||||
|
||||
|
|
|
@ -19,7 +19,9 @@ from searx.search.processors.abstract import EngineProcessor
|
|||
|
||||
logger = logger.getChild('search.processor.online')
|
||||
|
||||
DEFAULT_PARAMS = {
|
||||
|
||||
def default_request_params():
|
||||
return {
|
||||
'method': 'GET',
|
||||
'headers': {},
|
||||
'data': {},
|
||||
|
@ -27,7 +29,7 @@ DEFAULT_PARAMS = {
|
|||
'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 agent
|
||||
params['headers']['User-Agent'] = gen_useragent()
|
||||
|
|
Loading…
Reference in New Issue