[fix] revert language changes to prevent CAPTCHAs

This commit is contained in:
Adam Tauber 2017-11-22 22:50:48 +01:00
parent c1cfe97851
commit 6fdb6640d9
1 changed files with 4 additions and 4 deletions

View File

@ -89,7 +89,7 @@ url_map = 'https://www.openstreetmap.org/'\
search_path = '/search' search_path = '/search'
search_url = ('https://{hostname}' + search_url = ('https://{hostname}' +
search_path + 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_search = "&tbs=qdr:{range}"
time_range_dict = {'day': 'd', time_range_dict = {'day': 'd',
@ -167,11 +167,11 @@ def request(query, params):
if params['language'] == 'all': if params['language'] == 'all':
language = 'en' language = 'en'
country = 'US' country = 'US'
url_lang = 'en' url_lang = 'lang_en'
elif params['language'][:2] == 'jv': elif params['language'][:2] == 'jv':
language = 'jw' language = 'jw'
country = 'ID' country = 'ID'
url_lang = 'jw' url_lang = 'lang_jw'
else: else:
language_array = params['language'].lower().split('-') language_array = params['language'].lower().split('-')
if len(language_array) == 2: if len(language_array) == 2:
@ -179,7 +179,7 @@ def request(query, params):
else: else:
country = 'US' country = 'US'
language = language_array[0] + ',' + language_array[0] + '-' + country language = language_array[0] + ',' + language_array[0] + '-' + country
url_lang = language_array[0] url_lang = 'lang_' + language_array[0]
if use_locale_domain: if use_locale_domain:
google_hostname = country_to_hostname.get(country.upper(), default_hostname) google_hostname = country_to_hostname.get(country.upper(), default_hostname)