# SPDX-License-Identifier: AGPL-3.0-or-later """Google (Images) For detailed description of the *REST-full* API see: `Query Parameter Definitions`_. .. _admonition:: Content-Security-Policy (CSP) This engine needs to allow images from the `data URLs`_ (prefixed with the ``data:` scheme).:: Header set Content-Security-Policy "img-src 'self' data: ;" """ from urllib.parse import urlencode, unquote from lxml import html from searx import logger from searx.utils import extract_text, eval_xpath from searx.engines.google import _fetch_supported_languages, supported_languages_url # NOQA # pylint: disable=unused-import from searx.engines.google import ( get_lang_country, google_domains, time_range_dict, detect_google_sorry, ) logger = logger.getChild('google images') # about about = { "website": 'https://images.google.com/', "wikidata_id": 'Q521550', "official_api_documentation": 'https://developers.google.com/custom-search/docs/xml_results#WebSearch_Query_Parameter_Definitions', # NOQA "use_official_api": False, "require_api_key": False, "results": 'HTML', } # engine dependent config categories = ['images'] paging = False language_support = True use_locale_domain = True time_range_support = True safesearch = True filter_mapping = { 0: 'images', 1: 'active', 2: 'active' } def scrap_out_thumbs(dom): """Scrap out thumbnail data from