mirror of
https://github.com/searxng/searxng.git
synced 2025-03-12 15:41:15 +00:00
[fix] brave engine: add sec-fetch headers and source=web argument
The intention is to reduce the "TooManyRequestsException". Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
b0beb307ca
commit
8984d7ae02
1 changed files with 6 additions and 1 deletions
|
@ -30,7 +30,6 @@ Configured ``brave`` engines:
|
|||
brave_category: news
|
||||
|
||||
- name: brave.goggles
|
||||
brave_category: goggles
|
||||
time_range_support: true
|
||||
paging: true
|
||||
...
|
||||
|
@ -207,6 +206,7 @@ def request(query, params):
|
|||
|
||||
args = {
|
||||
'q': query,
|
||||
'source': 'web',
|
||||
}
|
||||
if brave_spellcheck:
|
||||
args['spellcheck'] = '1'
|
||||
|
@ -237,6 +237,11 @@ def request(query, params):
|
|||
|
||||
logger.debug("cookies %s", params['cookies'])
|
||||
|
||||
params['headers']['Sec-Fetch-Dest'] = "document"
|
||||
params['headers']['Sec-Fetch-Mode'] = "navigate"
|
||||
params['headers']['Sec-Fetch-Site'] = "same-origin"
|
||||
params['headers']['Sec-Fetch-User'] = "?1"
|
||||
|
||||
|
||||
def _extract_published_date(published_date_raw):
|
||||
if published_date_raw is None:
|
||||
|
|
Loading…
Reference in a new issue