From c89c05bcebb44699c94d6da2fcb8ad376b60fe67 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Tue, 25 Feb 2020 18:44:28 +0100 Subject: [PATCH] bugfix: google-news and bing-news has changed the language parameter closes: https://github.com/asciimoo/searx/issues/1838 Signed-off-by: Markus Heiser --- searx/engines/bing_news.py | 3 ++- searx/engines/google_news.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/searx/engines/bing_news.py b/searx/engines/bing_news.py index 669130c4..827555bd 100644 --- a/searx/engines/bing_news.py +++ b/searx/engines/bing_news.py @@ -58,8 +58,9 @@ def _get_url(query, language, offset, time_range): offset=offset, interval=time_range_dict[time_range]) else: + # e.g. setmkt=de-de&setlang=de search_path = search_string.format( - query=urlencode({'q': query, 'setmkt': language}), + query=urlencode({'q': query, 'setlang': language}), offset=offset) return base_url + search_path diff --git a/searx/engines/google_news.py b/searx/engines/google_news.py index 9c837b45..c9cc7543 100644 --- a/searx/engines/google_news.py +++ b/searx/engines/google_news.py @@ -54,7 +54,7 @@ def request(query, params): if params['language'] != 'all': language = match_language(params['language'], supported_languages, language_aliases).split('-')[0] if language: - params['url'] += '&lr=lang_' + language + params['url'] += '&hl=' + language return params