summaryrefslogtreecommitdiff
path: root/searx/engines/google_images.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/engines/google_images.py')
-rw-r--r--searx/engines/google_images.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py
index fc192d62d..e1f676dd6 100644
--- a/searx/engines/google_images.py
+++ b/searx/engines/google_images.py
@@ -51,6 +51,7 @@ paging = False
use_locale_domain = True
time_range_support = True
safesearch = True
+send_accept_language_header = True
filter_mapping = {0: 'images', 1: 'active', 2: 'active'}
@@ -125,23 +126,13 @@ def request(query, params):
"""Google-Video search request"""
lang_info = get_lang_info(params, supported_languages, language_aliases, False)
- logger.debug("HTTP header Accept-Language --> %s", lang_info['headers']['Accept-Language'])
query_url = (
'https://'
+ lang_info['subdomain']
+ '/search'
+ "?"
- + urlencode(
- {
- 'q': query,
- 'tbm': "isch",
- **lang_info['params'],
- 'ie': "utf8",
- 'oe': "utf8",
- 'num': 30,
- }
- )
+ + urlencode({'q': query, 'tbm': "isch", **lang_info['params'], 'ie': "utf8", 'oe': "utf8", 'num': 30})
)
if params['time_range'] in time_range_dict:
@@ -150,6 +141,7 @@ def request(query, params):
query_url += '&' + urlencode({'safe': filter_mapping[params['safesearch']]})
params['url'] = query_url
+ params['cookies']['CONSENT'] = "YES+"
params['headers'].update(lang_info['headers'])
params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
return params