diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2021-06-18 11:34:11 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2021-06-18 11:34:11 +0200 |
commit | dd7b53d3690e472fbc3f38c3d02ed377dc841a08 (patch) | |
tree | 5c764dcbda3d5c498dd110bfa76ff4007ef70651 /searx | |
parent | 4417d2b922fc01c44d0854d427a4e4c8603db861 (diff) | |
download | searxng-dd7b53d3690e472fbc3f38c3d02ed377dc841a08.tar.gz searxng-dd7b53d3690e472fbc3f38c3d02ed377dc841a08.zip |
[fix] google-news engine - KeyError: 'hl in request
Since we added
- 1c67b6aec [enh] google engine: supports "default language"
there is a KeyError: 'hl in request,error pattern::
ERROR:searx.searx.search.processor.online:engine google news : exception : 'hl'
Traceback (most recent call last):
File "searx/search/processors/online.py", line 144, in search
search_results = self._search_basic(query, params)
File "searx/search/processors/online.py", line 118, in _search_basic
self.engine.request(query, params)
File "searx/engines/google_news.py", line 97, in request
if lang_info['hl'] == 'en':
KeyError: 'hl'
Closes: https://github.com/searxng/searxng/issues/154
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rw-r--r-- | searx/engines/google_news.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/engines/google_news.py b/searx/engines/google_news.py index 485d602bc..38cbbd0ea 100644 --- a/searx/engines/google_news.py +++ b/searx/engines/google_news.py @@ -94,8 +94,8 @@ def request(query, params): ceid = "%s:%s" % (lang_info['country'], lang_info['language']) # google news redirects en to en-US - if lang_info['hl'] == 'en': - lang_info['hl'] = 'en-US' + if lang_info['params']['hl'] == 'en': + lang_info['params']['hl'] = 'en-US' # Very special to google-news compared to other google engines, the time # range is included in the search term. |