Skip to content

SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.

[fix] engine - google images error when no results

jazzzooob729542a6681
diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py
index e6445b1c4..1f9759c96 100644
--- a/searx/engines/google_images.py
+++ b/searx/engines/google_images.py
@@ -95,7 +95,7 @@ def response(resp):
json_start = resp.text.find('{"ischj":')
json_data = loads(resp.text[json_start:])
- for item in json_data["ischj"]["metadata"]:
+ for item in json_data["ischj"].get("metadata", []):
result_item = {
'url': item["result"]["referrer_url"],