浏览代码

[mod] ignore startpage unicode errors

Adam Tauber 10 年前
父节点
当前提交
c8be128e97
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      searx/engines/startpage.py

+ 4
- 1
searx/engines/startpage.py 查看文件

@@ -66,7 +66,10 @@ def response(resp):
66 66
             continue
67 67
         link = links[0]
68 68
         url = link.attrib.get('href')
69
-        title = escape(link.text_content())
69
+        try:
70
+            title = escape(link.text_content())
71
+        except UnicodeDecodeError:
72
+            continue
70 73
 
71 74
         # block google-ad url's
72 75
         if re.match("^http(s|)://www.google.[a-z]+/aclk.*$", url):