Merge pull request #3058 from e-foundation/3054-fix-google-images

Fix Google images crash

Closes #3054
This commit is contained in:
Noémi Ványi 2021-11-13 21:23:37 +01:00 committed by GitHub
commit 3531090ed6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -182,9 +182,9 @@ def get_lang_info(params, lang_list, custom_aliases, supported_any_language):
# https://developers.google.com/custom-search/docs/xml_results#lrsp
# Language Collection Values:
# https://developers.google.com/custom-search/docs/xml_results_appendices#languageCollections
ret_val['params']['lr'] = "lang_" + lang_list.get(lang_country, language)
ret_val['params']['lr'] = "lang_" + lang_country if lang_country in lang_list else language
ret_val['params']['hl'] = lang_list.get(lang_country, language)
ret_val['params']['hl'] = lang_country if lang_country in lang_list else language
# hl parameter:
# https://developers.google.com/custom-search/docs/xml_results#hlsp The