We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Bug: google images engine
**Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG**
30e4a2a2 

**How did you install SearXNG?**
docker, it happens on searx.be too.

**What happened?**
The engine crashes.

**How To Reproduce**
Search for anything using the engine, for example: `!goi anything`

**Expected behavior**
To get the results

**Screenshots & Logs**
![image](https://user-images.githubusercontent.com/1594191/123794822-968e0e00-d8e3-11eb-81cf-9836c1f76d98.png)

**Additional context**
Perhaps related to #175

**Technical report**

Error
  * Error: IndexError
  * Percentage: 5
  * Parameters: `()`
  * File name: `searx/engines/google_images.py:93`
  * Function: `scrap_img_by_id`
  * Code: `url_line = _script[i + 1]`



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `searx/engines/google_images.py`
Content:
```
1 # SPDX-License-Identifier: AGPL-3.0-or-later
2 # lint: pylint
3 """This is the implementation of the google images engine.
4 
5 .. admonition:: Content-Security-Policy (CSP)
6 
7    This engine needs to allow images from the `data URLs`_ (prefixed with the
8    ``data:`` scheme)::
9 
10        Header set Content-Security-Policy "img-src 'self' data: ;"
11 
12 .. _data URLs:
13    https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
14 """
15 
16 from urllib.parse import urlencode, unquote
17 from lxml import html
18 
19 from searx import logger
20 from searx.utils import (
21     eval_xpath,
22     eval_xpath_list,
23     eval_xpath_getindex,
24     extract_text,
25 )
26 
27 from searx.engines.google import (
28     get_lang_info,
29     time_range_dict,
30     detect_google_sorry,
31 )
32 
33 # pylint: disable=unused-import
34 from searx.engines.google import (
35     supported_languages_url
36     ,  _fetch_supported_languages
37 )
38 # pylint: enable=unused-import
39 
40 logger = logger.getChild('google images')
41 
42 # about
43 about = {
44     "website": 'https://images.google.com',
45     "wikidata_id": 'Q521550',
46     "official_api_documentation": 'https://developers.google.com/custom-search',
47     "use_official_api": False,
48     "require_api_key": False,
49     "results": 'HTML',
50 }
51 
52 # engine dependent config
53 categories = ['images']
54 paging = False
55 use_locale_domain = True
56 time_range_support = True
57 safesearch = True
58 
59 filter_mapping = {
60     0: 'images',
61     1: 'active',
62     2: 'active'
63 }
64 
65 
66 def scrap_out_thumbs(dom):
67     """Scrap out thumbnail data from <script> tags.
68     """
69     ret_val = dict()
70     for script in eval_xpath(dom, '//script[contains(., "_setImgSrc(")]'):
71         _script = script.text
72         # _setImgSrc('0','data:image\/jpeg;base64,\/9j\/4AAQSkZJR ....');
73         _thumb_no, _img_data = _script[len("_setImgSrc("):-2].split(",", 1)
74         _thumb_no = _thumb_no.replace("'", "")
75         _img_data = _img_data.replace("'", "")
76         _img_data = _img_data.replace(r"\/", r"/")
77         ret_val[_thumb_no] = _img_data.replace(r"\x3d", "=")
78     return ret_val
79 
80 
81 def scrap_img_by_id(script, data_id):
82     """Get full image URL by data-id in parent element
83     """
84     img_url = ''
85     _script = script.split('\n')
86     for i, line in enumerate(_script):
87         if 'gstatic.com/images' in line and data_id in line:
88             url_line = _script[i + 1]
89             img_url = url_line.split('"')[1]
90             img_url = unquote(img_url.replace(r'\u00', r'%'))
91     return img_url
92 
93 
94 def request(query, params):
95     """Google-Video search request"""
96 
97     lang_info = get_lang_info(
98         # pylint: disable=undefined-variable
99         params, supported_languages, language_aliases, False
100     )
101     logger.debug(
102         "HTTP header Accept-Language --> %s", lang_info['headers']['Accept-Language'])
103 
104     query_url = 'https://' + lang_info['subdomain'] + '/search' + "?" + urlencode({
105         'q': query,
106         'tbm': "isch",
107         **lang_info['params'],
108         'ie': "utf8",
109         'oe': "utf8",
110         'num': 30,
111     })
112 
113     if params['time_range'] in time_range_dict:
114         query_url += '&' + urlencode({'tbs': 'qdr:' + time_range_dict[params['time_range']]})
115     if params['safesearch']:
116         query_url += '&' + urlencode({'safe': filter_mapping[params['safesearch']]})
117     params['url'] = query_url
118 
119     params['headers'].update(lang_info['headers'])
120     params['headers']['Accept'] = (
121         'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
122     )
123     return params
124 
125 
126 def response(resp):
127     """Get response from google's search request"""
128     results = []
129 
130     detect_google_sorry(resp)
131 
132     # convert the text to dom
133     dom = html.fromstring(resp.text)
134     img_bas64_map = scrap_out_thumbs(dom)
135     img_src_script = eval_xpath_getindex(
136         dom, '//script[contains(., "AF_initDataCallback({key: ")]', 1).text
137 
138     # parse results
139     #
140     # root element::
141     #     <div id="islmp" ..>
142     # result div per image::
143     #     <div jsmodel="tTXmib"> / <div jsaction="..." data-id="..."
144     #     The data-id matches to a item in a json-data structure in::
145     #         <script nonce="I+vqelcy/01CKiBJi5Z1Ow">AF_initDataCallback({key: 'ds:1', ... data:function(){return [ ...
146     #     In this structure the link to the origin PNG, JPG or whatever is given
147     # first link per image-div contains a <img> with the data-iid for bas64 encoded image data::
148     #      <img class="rg_i Q4LuWd" data-iid="0"
149     # second link per image-div is the target link::
150     #      <a class="VFACy kGQAp" href="https://en.wikipedia.org/wiki/The_Sacrament_of_the_Last_Supper">
151     # the second link also contains two div tags with the *description* and *publisher*::
152     #      <div class="WGvvNb">The Sacrament of the Last Supper ...</div>
153     #      <div class="fxgdke">en.wikipedia.org</div>
154 
155     root = eval_xpath(dom, '//div[@id="islmp"]')
156     if not root:
157         logger.error("did not find root element id='islmp'")
158         return results
159 
160     root = root[0]
161     for img_node in eval_xpath_list(root, './/img[contains(@class, "rg_i")]'):
162 
163         img_alt = eval_xpath_getindex(img_node, '@alt', 0)
164 
165         img_base64_id = eval_xpath(img_node, '@data-iid')
166         if img_base64_id:
167             img_base64_id = img_base64_id[0]
168             thumbnail_src = img_bas64_map[img_base64_id]
169         else:
170             thumbnail_src = eval_xpath(img_node, '@src')
171             if not thumbnail_src:
172                 thumbnail_src = eval_xpath(img_node, '@data-src')
173             if thumbnail_src:
174                 thumbnail_src = thumbnail_src[0]
175             else:
176                 thumbnail_src = ''
177 
178         link_node = eval_xpath_getindex(img_node, '../../../a[2]', 0)
179         url = eval_xpath_getindex(link_node, '@href', 0)
180 
181         pub_nodes = eval_xpath(link_node, './div/div')
182         pub_descr = img_alt
183         pub_source = ''
184         if pub_nodes:
185             pub_descr = extract_text(pub_nodes[0])
186             pub_source = extract_text(pub_nodes[1])
187 
188         img_src_id = eval_xpath_getindex(img_node, '../../../@data-id', 0)
189         src_url = scrap_img_by_id(img_src_script, img_src_id)
190         if not src_url:
191             src_url = thumbnail_src
192 
193         results.append({
194             'url': url,
195             'title': img_alt,
196             'content': pub_descr,
197             'source': pub_source,
198             'img_src': src_url,
199             # 'img_format': img_format,
200             'thumbnail_src': thumbnail_src,
201             'template': 'images.html'
202         })
203 
204     return results
205
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py
--- a/searx/engines/google_images.py
+++ b/searx/engines/google_images.py
@@ -84,7 +84,7 @@
     img_url = ''
     _script = script.split('\n')
     for i, line in enumerate(_script):
-        if 'gstatic.com/images' in line and data_id in line:
+        if 'gstatic.com/images' in line and data_id in line and i + 1 < len(_script):
             url_line = _script[i + 1]
             img_url = url_line.split('"')[1]
             img_url = unquote(img_url.replace(r'\u00', r'%'))

{"golden_diff": "diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py\n--- a/searx/engines/google_images.py\n+++ b/searx/engines/google_images.py\n@@ -84,7 +84,7 @@\n     img_url = ''\n     _script = script.split('\\n')\n     for i, line in enumerate(_script):\n-        if 'gstatic.com/images' in line and data_id in line:\n+        if 'gstatic.com/images' in line and data_id in line and i + 1 < len(_script):\n             url_line = _script[i + 1]\n             img_url = url_line.split('\"')[1]\n             img_url = unquote(img_url.replace(r'\\u00', r'%'))\n", "issue": "Bug: google images engine\n**Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG**\r\n30e4a2a2 \r\n\r\n**How did you install SearXNG?**\r\ndocker, it happens on searx.be too.\r\n\r\n**What happened?**\r\nThe engine crashes.\r\n\r\n**How To Reproduce**\r\nSearch for anything using the engine, for example: `!goi anything`\r\n\r\n**Expected behavior**\r\nTo get the results\r\n\r\n**Screenshots & Logs**\r\n![image](https://user-images.githubusercontent.com/1594191/123794822-968e0e00-d8e3-11eb-81cf-9836c1f76d98.png)\r\n\r\n**Additional context**\r\nPerhaps related to #175\r\n\r\n**Technical report**\r\n\r\nError\r\n  * Error: IndexError\r\n  * Percentage: 5\r\n  * Parameters: `()`\r\n  * File name: `searx/engines/google_images.py:93`\r\n  * Function: `scrap_img_by_id`\r\n  * Code: `url_line = _script[i + 1]`\r\n\r\n\n", "before_files": [{"content": "# SPDX-License-Identifier: AGPL-3.0-or-later\n# lint: pylint\n\"\"\"This is the implementation of the google images engine.\n\n.. admonition:: Content-Security-Policy (CSP)\n\n   This engine needs to allow images from the `data URLs`_ (prefixed with the\n   ``data:`` scheme)::\n\n       Header set Content-Security-Policy \"img-src 'self' data: ;\"\n\n.. _data URLs:\n   https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n\"\"\"\n\nfrom urllib.parse import urlencode, unquote\nfrom lxml import html\n\nfrom searx import logger\nfrom searx.utils import (\n    eval_xpath,\n    eval_xpath_list,\n    eval_xpath_getindex,\n    extract_text,\n)\n\nfrom searx.engines.google import (\n    get_lang_info,\n    time_range_dict,\n    detect_google_sorry,\n)\n\n# pylint: disable=unused-import\nfrom searx.engines.google import (\n    supported_languages_url\n    ,  _fetch_supported_languages\n)\n# pylint: enable=unused-import\n\nlogger = logger.getChild('google images')\n\n# about\nabout = {\n    \"website\": 'https://images.google.com',\n    \"wikidata_id\": 'Q521550',\n    \"official_api_documentation\": 'https://developers.google.com/custom-search',\n    \"use_official_api\": False,\n    \"require_api_key\": False,\n    \"results\": 'HTML',\n}\n\n# engine dependent config\ncategories = ['images']\npaging = False\nuse_locale_domain = True\ntime_range_support = True\nsafesearch = True\n\nfilter_mapping = {\n    0: 'images',\n    1: 'active',\n    2: 'active'\n}\n\n\ndef scrap_out_thumbs(dom):\n    \"\"\"Scrap out thumbnail data from <script> tags.\n    \"\"\"\n    ret_val = dict()\n    for script in eval_xpath(dom, '//script[contains(., \"_setImgSrc(\")]'):\n        _script = script.text\n        # _setImgSrc('0','data:image\\/jpeg;base64,\\/9j\\/4AAQSkZJR ....');\n        _thumb_no, _img_data = _script[len(\"_setImgSrc(\"):-2].split(\",\", 1)\n        _thumb_no = _thumb_no.replace(\"'\", \"\")\n        _img_data = _img_data.replace(\"'\", \"\")\n        _img_data = _img_data.replace(r\"\\/\", r\"/\")\n        ret_val[_thumb_no] = _img_data.replace(r\"\\x3d\", \"=\")\n    return ret_val\n\n\ndef scrap_img_by_id(script, data_id):\n    \"\"\"Get full image URL by data-id in parent element\n    \"\"\"\n    img_url = ''\n    _script = script.split('\\n')\n    for i, line in enumerate(_script):\n        if 'gstatic.com/images' in line and data_id in line:\n            url_line = _script[i + 1]\n            img_url = url_line.split('\"')[1]\n            img_url = unquote(img_url.replace(r'\\u00', r'%'))\n    return img_url\n\n\ndef request(query, params):\n    \"\"\"Google-Video search request\"\"\"\n\n    lang_info = get_lang_info(\n        # pylint: disable=undefined-variable\n        params, supported_languages, language_aliases, False\n    )\n    logger.debug(\n        \"HTTP header Accept-Language --> %s\", lang_info['headers']['Accept-Language'])\n\n    query_url = 'https://' + lang_info['subdomain'] + '/search' + \"?\" + urlencode({\n        'q': query,\n        'tbm': \"isch\",\n        **lang_info['params'],\n        'ie': \"utf8\",\n        'oe': \"utf8\",\n        'num': 30,\n    })\n\n    if params['time_range'] in time_range_dict:\n        query_url += '&' + urlencode({'tbs': 'qdr:' + time_range_dict[params['time_range']]})\n    if params['safesearch']:\n        query_url += '&' + urlencode({'safe': filter_mapping[params['safesearch']]})\n    params['url'] = query_url\n\n    params['headers'].update(lang_info['headers'])\n    params['headers']['Accept'] = (\n        'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'\n    )\n    return params\n\n\ndef response(resp):\n    \"\"\"Get response from google's search request\"\"\"\n    results = []\n\n    detect_google_sorry(resp)\n\n    # convert the text to dom\n    dom = html.fromstring(resp.text)\n    img_bas64_map = scrap_out_thumbs(dom)\n    img_src_script = eval_xpath_getindex(\n        dom, '//script[contains(., \"AF_initDataCallback({key: \")]', 1).text\n\n    # parse results\n    #\n    # root element::\n    #     <div id=\"islmp\" ..>\n    # result div per image::\n    #     <div jsmodel=\"tTXmib\"> / <div jsaction=\"...\" data-id=\"...\"\n    #     The data-id matches to a item in a json-data structure in::\n    #         <script nonce=\"I+vqelcy/01CKiBJi5Z1Ow\">AF_initDataCallback({key: 'ds:1', ... data:function(){return [ ...\n    #     In this structure the link to the origin PNG, JPG or whatever is given\n    # first link per image-div contains a <img> with the data-iid for bas64 encoded image data::\n    #      <img class=\"rg_i Q4LuWd\" data-iid=\"0\"\n    # second link per image-div is the target link::\n    #      <a class=\"VFACy kGQAp\" href=\"https://en.wikipedia.org/wiki/The_Sacrament_of_the_Last_Supper\">\n    # the second link also contains two div tags with the *description* and *publisher*::\n    #      <div class=\"WGvvNb\">The Sacrament of the Last Supper ...</div>\n    #      <div class=\"fxgdke\">en.wikipedia.org</div>\n\n    root = eval_xpath(dom, '//div[@id=\"islmp\"]')\n    if not root:\n        logger.error(\"did not find root element id='islmp'\")\n        return results\n\n    root = root[0]\n    for img_node in eval_xpath_list(root, './/img[contains(@class, \"rg_i\")]'):\n\n        img_alt = eval_xpath_getindex(img_node, '@alt', 0)\n\n        img_base64_id = eval_xpath(img_node, '@data-iid')\n        if img_base64_id:\n            img_base64_id = img_base64_id[0]\n            thumbnail_src = img_bas64_map[img_base64_id]\n        else:\n            thumbnail_src = eval_xpath(img_node, '@src')\n            if not thumbnail_src:\n                thumbnail_src = eval_xpath(img_node, '@data-src')\n            if thumbnail_src:\n                thumbnail_src = thumbnail_src[0]\n            else:\n                thumbnail_src = ''\n\n        link_node = eval_xpath_getindex(img_node, '../../../a[2]', 0)\n        url = eval_xpath_getindex(link_node, '@href', 0)\n\n        pub_nodes = eval_xpath(link_node, './div/div')\n        pub_descr = img_alt\n        pub_source = ''\n        if pub_nodes:\n            pub_descr = extract_text(pub_nodes[0])\n            pub_source = extract_text(pub_nodes[1])\n\n        img_src_id = eval_xpath_getindex(img_node, '../../../@data-id', 0)\n        src_url = scrap_img_by_id(img_src_script, img_src_id)\n        if not src_url:\n            src_url = thumbnail_src\n\n        results.append({\n            'url': url,\n            'title': img_alt,\n            'content': pub_descr,\n            'source': pub_source,\n            'img_src': src_url,\n            # 'img_format': img_format,\n            'thumbnail_src': thumbnail_src,\n            'template': 'images.html'\n        })\n\n    return results\n", "path": "searx/engines/google_images.py"}], "after_files": [{"content": "# SPDX-License-Identifier: AGPL-3.0-or-later\n# lint: pylint\n\"\"\"This is the implementation of the google images engine.\n\n.. admonition:: Content-Security-Policy (CSP)\n\n   This engine needs to allow images from the `data URLs`_ (prefixed with the\n   ``data:`` scheme)::\n\n       Header set Content-Security-Policy \"img-src 'self' data: ;\"\n\n.. _data URLs:\n   https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\n\"\"\"\n\nfrom urllib.parse import urlencode, unquote\nfrom lxml import html\n\nfrom searx import logger\nfrom searx.utils import (\n    eval_xpath,\n    eval_xpath_list,\n    eval_xpath_getindex,\n    extract_text,\n)\n\nfrom searx.engines.google import (\n    get_lang_info,\n    time_range_dict,\n    detect_google_sorry,\n)\n\n# pylint: disable=unused-import\nfrom searx.engines.google import (\n    supported_languages_url\n    ,  _fetch_supported_languages\n)\n# pylint: enable=unused-import\n\nlogger = logger.getChild('google images')\n\n# about\nabout = {\n    \"website\": 'https://images.google.com',\n    \"wikidata_id\": 'Q521550',\n    \"official_api_documentation\": 'https://developers.google.com/custom-search',\n    \"use_official_api\": False,\n    \"require_api_key\": False,\n    \"results\": 'HTML',\n}\n\n# engine dependent config\ncategories = ['images']\npaging = False\nuse_locale_domain = True\ntime_range_support = True\nsafesearch = True\n\nfilter_mapping = {\n    0: 'images',\n    1: 'active',\n    2: 'active'\n}\n\n\ndef scrap_out_thumbs(dom):\n    \"\"\"Scrap out thumbnail data from <script> tags.\n    \"\"\"\n    ret_val = dict()\n    for script in eval_xpath(dom, '//script[contains(., \"_setImgSrc(\")]'):\n        _script = script.text\n        # _setImgSrc('0','data:image\\/jpeg;base64,\\/9j\\/4AAQSkZJR ....');\n        _thumb_no, _img_data = _script[len(\"_setImgSrc(\"):-2].split(\",\", 1)\n        _thumb_no = _thumb_no.replace(\"'\", \"\")\n        _img_data = _img_data.replace(\"'\", \"\")\n        _img_data = _img_data.replace(r\"\\/\", r\"/\")\n        ret_val[_thumb_no] = _img_data.replace(r\"\\x3d\", \"=\")\n    return ret_val\n\n\ndef scrap_img_by_id(script, data_id):\n    \"\"\"Get full image URL by data-id in parent element\n    \"\"\"\n    img_url = ''\n    _script = script.split('\\n')\n    for i, line in enumerate(_script):\n        if 'gstatic.com/images' in line and data_id in line and i + 1 < len(_script):\n            url_line = _script[i + 1]\n            img_url = url_line.split('\"')[1]\n            img_url = unquote(img_url.replace(r'\\u00', r'%'))\n    return img_url\n\n\ndef request(query, params):\n    \"\"\"Google-Video search request\"\"\"\n\n    lang_info = get_lang_info(\n        # pylint: disable=undefined-variable\n        params, supported_languages, language_aliases, False\n    )\n    logger.debug(\n        \"HTTP header Accept-Language --> %s\", lang_info['headers']['Accept-Language'])\n\n    query_url = 'https://' + lang_info['subdomain'] + '/search' + \"?\" + urlencode({\n        'q': query,\n        'tbm': \"isch\",\n        **lang_info['params'],\n        'ie': \"utf8\",\n        'oe': \"utf8\",\n        'num': 30,\n    })\n\n    if params['time_range'] in time_range_dict:\n        query_url += '&' + urlencode({'tbs': 'qdr:' + time_range_dict[params['time_range']]})\n    if params['safesearch']:\n        query_url += '&' + urlencode({'safe': filter_mapping[params['safesearch']]})\n    params['url'] = query_url\n\n    params['headers'].update(lang_info['headers'])\n    params['headers']['Accept'] = (\n        'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'\n    )\n    return params\n\n\ndef response(resp):\n    \"\"\"Get response from google's search request\"\"\"\n    results = []\n\n    detect_google_sorry(resp)\n\n    # convert the text to dom\n    dom = html.fromstring(resp.text)\n    img_bas64_map = scrap_out_thumbs(dom)\n    img_src_script = eval_xpath_getindex(\n        dom, '//script[contains(., \"AF_initDataCallback({key: \")]', 1).text\n\n    # parse results\n    #\n    # root element::\n    #     <div id=\"islmp\" ..>\n    # result div per image::\n    #     <div jsmodel=\"tTXmib\"> / <div jsaction=\"...\" data-id=\"...\"\n    #     The data-id matches to a item in a json-data structure in::\n    #         <script nonce=\"I+vqelcy/01CKiBJi5Z1Ow\">AF_initDataCallback({key: 'ds:1', ... data:function(){return [ ...\n    #     In this structure the link to the origin PNG, JPG or whatever is given\n    # first link per image-div contains a <img> with the data-iid for bas64 encoded image data::\n    #      <img class=\"rg_i Q4LuWd\" data-iid=\"0\"\n    # second link per image-div is the target link::\n    #      <a class=\"VFACy kGQAp\" href=\"https://en.wikipedia.org/wiki/The_Sacrament_of_the_Last_Supper\">\n    # the second link also contains two div tags with the *description* and *publisher*::\n    #      <div class=\"WGvvNb\">The Sacrament of the Last Supper ...</div>\n    #      <div class=\"fxgdke\">en.wikipedia.org</div>\n\n    root = eval_xpath(dom, '//div[@id=\"islmp\"]')\n    if not root:\n        logger.error(\"did not find root element id='islmp'\")\n        return results\n\n    root = root[0]\n    for img_node in eval_xpath_list(root, './/img[contains(@class, \"rg_i\")]'):\n\n        img_alt = eval_xpath_getindex(img_node, '@alt', 0)\n\n        img_base64_id = eval_xpath(img_node, '@data-iid')\n        if img_base64_id:\n            img_base64_id = img_base64_id[0]\n            thumbnail_src = img_bas64_map[img_base64_id]\n        else:\n            thumbnail_src = eval_xpath(img_node, '@src')\n            if not thumbnail_src:\n                thumbnail_src = eval_xpath(img_node, '@data-src')\n            if thumbnail_src:\n                thumbnail_src = thumbnail_src[0]\n            else:\n                thumbnail_src = ''\n\n        link_node = eval_xpath_getindex(img_node, '../../../a[2]', 0)\n        url = eval_xpath_getindex(link_node, '@href', 0)\n\n        pub_nodes = eval_xpath(link_node, './div/div')\n        pub_descr = img_alt\n        pub_source = ''\n        if pub_nodes:\n            pub_descr = extract_text(pub_nodes[0])\n            pub_source = extract_text(pub_nodes[1])\n\n        img_src_id = eval_xpath_getindex(img_node, '../../../@data-id', 0)\n        src_url = scrap_img_by_id(img_src_script, img_src_id)\n        if not src_url:\n            src_url = thumbnail_src\n\n        results.append({\n            'url': url,\n            'title': img_alt,\n            'content': pub_descr,\n            'source': pub_source,\n            'img_src': src_url,\n            # 'img_format': img_format,\n            'thumbnail_src': thumbnail_src,\n            'template': 'images.html'\n        })\n\n    return results\n", "path": "searx/engines/google_images.py"}]}