mirror of
https://github.com/searxng/searxng
synced 2024-01-01 18:24:07 +00:00
bugfix: google-news and bing-news has changed the language parameter
closes: https://github.com/asciimoo/searx/issues/1838 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
6a3ef5561b
commit
c89c05bceb
@ -58,8 +58,9 @@ def _get_url(query, language, offset, time_range):
|
|||||||
offset=offset,
|
offset=offset,
|
||||||
interval=time_range_dict[time_range])
|
interval=time_range_dict[time_range])
|
||||||
else:
|
else:
|
||||||
|
# e.g. setmkt=de-de&setlang=de
|
||||||
search_path = search_string.format(
|
search_path = search_string.format(
|
||||||
query=urlencode({'q': query, 'setmkt': language}),
|
query=urlencode({'q': query, 'setlang': language}),
|
||||||
offset=offset)
|
offset=offset)
|
||||||
return base_url + search_path
|
return base_url + search_path
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ def request(query, params):
|
|||||||
if params['language'] != 'all':
|
if params['language'] != 'all':
|
||||||
language = match_language(params['language'], supported_languages, language_aliases).split('-')[0]
|
language = match_language(params['language'], supported_languages, language_aliases).split('-')[0]
|
||||||
if language:
|
if language:
|
||||||
params['url'] += '&lr=lang_' + language
|
params['url'] += '&hl=' + language
|
||||||
|
|
||||||
return params
|
return params
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user