forked from zaclys/searxng
commit
eb6832eb95
|
@ -19,6 +19,7 @@ Definitions`_. Not all parameters can be appied:
|
||||||
# pylint: disable=invalid-name, missing-function-docstring
|
# pylint: disable=invalid-name, missing-function-docstring
|
||||||
|
|
||||||
import binascii
|
import binascii
|
||||||
|
from datetime import datetime
|
||||||
import re
|
import re
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
from base64 import b64decode
|
from base64 import b64decode
|
||||||
|
@ -94,8 +95,8 @@ def request(query, params):
|
||||||
ceid = "%s:%s" % (lang_info['country'], lang_info['language'])
|
ceid = "%s:%s" % (lang_info['country'], lang_info['language'])
|
||||||
|
|
||||||
# google news redirects en to en-US
|
# google news redirects en to en-US
|
||||||
if lang_info['hl'] == 'en':
|
if lang_info['params']['hl'] == 'en':
|
||||||
lang_info['hl'] = 'en-US'
|
lang_info['params']['hl'] = 'en-US'
|
||||||
|
|
||||||
# Very special to google-news compared to other google engines, the time
|
# Very special to google-news compared to other google engines, the time
|
||||||
# range is included in the search term.
|
# range is included in the search term.
|
||||||
|
@ -115,6 +116,7 @@ def request(query, params):
|
||||||
params['headers']['Accept'] = (
|
params['headers']['Accept'] = (
|
||||||
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
|
'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
|
||||||
)
|
)
|
||||||
|
params['headers']['Cookie'] = "CONSENT=YES+cb.%s-14-p0.en+F+941;" % datetime.now().strftime("%Y%m%d")
|
||||||
|
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue