mirror of
https://github.com/searxng/searxng.git
synced 2024-12-23 01:36:29 +00:00
[enh] Allow passing headers/cookies from settings.yml
Example: - engine: xpath - search_url: example.org - headers: {'example_header': 'example_header'} - cookies: {'safesearch': 'off'}
This commit is contained in:
parent
c474616642
commit
155333f625
1 changed files with 8 additions and 0 deletions
|
@ -85,6 +85,11 @@ suggestion_xpath = ''
|
||||||
cached_xpath = ''
|
cached_xpath = ''
|
||||||
cached_url = ''
|
cached_url = ''
|
||||||
|
|
||||||
|
cookies = {}
|
||||||
|
headers = {}
|
||||||
|
'''Some engines might offer different result based on cookies or headers.
|
||||||
|
Possible use-case: To set safesearch cookie or header to moderate.'''
|
||||||
|
|
||||||
paging = False
|
paging = False
|
||||||
'''Engine supports paging [True or False].'''
|
'''Engine supports paging [True or False].'''
|
||||||
|
|
||||||
|
@ -166,6 +171,9 @@ def request(query, params):
|
||||||
'safe_search': safe_search,
|
'safe_search': safe_search,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
params['cookies'] = cookies
|
||||||
|
params['headers'] = headers
|
||||||
|
|
||||||
params['url'] = search_url.format(**fargs)
|
params['url'] = search_url.format(**fargs)
|
||||||
params['soft_max_redirects'] = soft_max_redirects
|
params['soft_max_redirects'] = soft_max_redirects
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue