diff options
author | Marc Abonce Seguin <marc-abonce@mailbox.org> | 2018-04-18 22:55:37 -0500 |
---|---|---|
committer | Marc Abonce Seguin <marc-abonce@mailbox.org> | 2018-04-18 23:29:48 -0500 |
commit | f7f9c50393785c8d6ad6c40a4c507b292ea438b1 (patch) | |
tree | 8a2e45d4ac35f898a4ba2f6661fc7a99771c7514 /searx/engines | |
parent | 49b6206d6cbfdc19e2bb2c42e999fd7caa776a09 (diff) | |
download | searxng-f7f9c50393785c8d6ad6c40a4c507b292ea438b1.tar.gz searxng-f7f9c50393785c8d6ad6c40a4c507b292ea438b1.zip |
[fix] force English results in Google when using en-US
Diffstat (limited to 'searx/engines')
-rw-r--r-- | searx/engines/google.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/searx/engines/google.py b/searx/engines/google.py index 93075e2dc..62e7d1170 100644 --- a/searx/engines/google.py +++ b/searx/engines/google.py @@ -91,7 +91,7 @@ url_map = 'https://www.openstreetmap.org/'\ search_path = '/search' search_url = ('https://{hostname}' + search_path + - '?{query}&start={offset}&gws_rd=cr&gbv=1&lr={lang}&ei=x') + '?{query}&start={offset}&gws_rd=cr&gbv=1&lr={lang}&hl={lang_short}&ei=x') time_range_search = "&tbs=qdr:{range}" time_range_dict = {'day': 'd', @@ -175,10 +175,6 @@ def request(query, params): else: country = 'US' - # temporary fix until a way of supporting en-US is found - if language == 'en-US': - country = 'GB' - url_lang = 'lang_' + language if use_locale_domain: @@ -191,7 +187,8 @@ def request(query, params): params['url'] = search_url.format(offset=offset, query=urlencode({'q': query}), hostname=google_hostname, - lang=url_lang) + lang=url_lang, + lang_short=language) if params['time_range'] in time_range_dict: params['url'] += time_range_search.format(range=time_range_dict[params['time_range']]) |