Browse Source

[fix] engine - google images error when no results

jazzzooo 1 year ago
parent
commit
b729542a66
1 changed files with 1 additions and 1 deletions
  1. 1 1
      searx/engines/google_images.py

+ 1 - 1
searx/engines/google_images.py

@@ -95,7 +95,7 @@ def response(resp):
     json_start = resp.text.find('{"ischj":')
     json_start = resp.text.find('{"ischj":')
     json_data = loads(resp.text[json_start:])
     json_data = loads(resp.text[json_start:])
 
 
-    for item in json_data["ischj"]["metadata"]:
+    for item in json_data["ischj"].get("metadata", []):
 
 
         result_item = {
         result_item = {
             'url': item["result"]["referrer_url"],
             'url': item["result"]["referrer_url"],