forked from Ponysearch/Ponysearch
Merge pull request #2498 from dalf/minor-fix-google-news
[fix] google_news: avoid one HTTP redirect except for the English results
This commit is contained in:
commit
f4a17acb7a
1 changed files with 5 additions and 1 deletions
|
@ -85,7 +85,7 @@ def request(query, params):
|
||||||
|
|
||||||
query_url = 'https://'+ subdomain + '/search' + "?" + urlencode({
|
query_url = 'https://'+ subdomain + '/search' + "?" + urlencode({
|
||||||
'q': query,
|
'q': query,
|
||||||
'hl': lang_country,
|
'hl': language,
|
||||||
'lr': "lang_" + language,
|
'lr': "lang_" + language,
|
||||||
'ie': "utf8",
|
'ie': "utf8",
|
||||||
'oe': "utf8",
|
'oe': "utf8",
|
||||||
|
@ -108,6 +108,10 @@ 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'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# hl=en redirect to hl=en-US / en-CA ...
|
||||||
|
params['soft_max_redirects'] = 1
|
||||||
|
|
||||||
#params['google_subdomain'] = subdomain
|
#params['google_subdomain'] = subdomain
|
||||||
|
|
||||||
return params
|
return params
|
||||||
|
|
Loading…
Reference in a new issue