浏览代码

[mod] add more error handling to json engine II.

Adam Tauber 7 年前
父节点
当前提交
7a9b18e9e9
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5
    2
      searx/engines/json_engine.py

+ 5
- 2
searx/engines/json_engine.py 查看文件

@@ -102,8 +102,11 @@ def response(resp):
102 102
         if not len(rs):
103 103
             return results
104 104
         for result in rs[0]:
105
-            url = query(result, url_query)[0]
106
-            title = query(result, title_query)[0]
105
+            try:
106
+                url = query(result, url_query)[0]
107
+                title = query(result, title_query)[0]
108
+            except:
109
+                continue
107 110
             try:
108 111
                 content = query(result, content_query)[0]
109 112
             except: