summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2017-11-22 22:50:48 +0100
committerAdam Tauber <asciimoo@gmail.com>2017-11-22 22:50:48 +0100
commit6fdb6640d9e644860f60bf9cd59847c2d359fc8a (patch)
tree669092c15fe85374f9ea0f259dd6edf9e8491718
parentc1cfe978511c800cdbdbebee2306139524dc715b (diff)
downloadsearxng-6fdb6640d9e644860f60bf9cd59847c2d359fc8a.tar.gz
searxng-6fdb6640d9e644860f60bf9cd59847c2d359fc8a.zip
[fix] revert language changes to prevent CAPTCHAs
-rw-r--r--searx/engines/google.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/searx/engines/google.py b/searx/engines/google.py
index 03842234f..f734ef72e 100644
--- a/searx/engines/google.py
+++ b/searx/engines/google.py
@@ -89,7 +89,7 @@ url_map = 'https://www.openstreetmap.org/'\
search_path = '/search'
search_url = ('https://{hostname}' +
search_path +
- '?{query}&start={offset}&gws_rd=cr&gbv=1&hl={lang}&ei=x')
+ '?{query}&start={offset}&gws_rd=cr&gbv=1&lr={lang}&ei=x')
time_range_search = "&tbs=qdr:{range}"
time_range_dict = {'day': 'd',
@@ -167,11 +167,11 @@ def request(query, params):
if params['language'] == 'all':
language = 'en'
country = 'US'
- url_lang = 'en'
+ url_lang = 'lang_en'
elif params['language'][:2] == 'jv':
language = 'jw'
country = 'ID'
- url_lang = 'jw'
+ url_lang = 'lang_jw'
else:
language_array = params['language'].lower().split('-')
if len(language_array) == 2:
@@ -179,7 +179,7 @@ def request(query, params):
else:
country = 'US'
language = language_array[0] + ',' + language_array[0] + '-' + country
- url_lang = language_array[0]
+ url_lang = 'lang_' + language_array[0]
if use_locale_domain:
google_hostname = country_to_hostname.get(country.upper(), default_hostname)