summaryrefslogtreecommitdiff
path: root/searx/engines/google.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-08-01 17:01:59 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2022-08-01 17:01:59 +0200
commit8df1f0c47e03fe7525c40a2856dba950bab8998b (patch)
tree844dc7ca4d31f0ff97c07d1817dbfba591420b30 /searx/engines/google.py
parenta2badb4fe47eaa6df26b7bc0ef601cb9179edc3a (diff)
[mod] add 'Accept-Language' HTTP header to online processores
Most engines that support languages (and regions) use the Accept-Language from the WEB browser to build a response that fits to the language (and region). - add new engine option: send_accept_language_header Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/engines/google.py')
-rw-r--r--searx/engines/google.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/searx/engines/google.py b/searx/engines/google.py
index 0d116db9f..5e80f6dcc 100644
--- a/searx/engines/google.py
+++ b/searx/engines/google.py
@@ -45,6 +45,7 @@ categories = ['general', 'web']
paging = True
time_range_support = True
safesearch = True
+send_accept_language_header = True
use_mobile_ui = False
supported_languages_url = 'https://www.google.com/preferences?#languages'
@@ -241,16 +242,6 @@ def get_lang_info(params, lang_list, custom_aliases, supported_any_language):
# language.
ret_val['params']['lr'] = "lang_" + lang_list.get(lang_country, language)
- # Accept-Language: fr-CH, fr;q=0.8, en;q=0.6, *;q=0.5
- ret_val['headers']['Accept-Language'] = ','.join(
- [
- lang_country,
- language + ';q=0.8,',
- 'en;q=0.6',
- '*;q=0.5',
- ]
- )
-
return ret_val