Procházet zdrojové kódy

[mod] ignore startpage unicode errors

Adam Tauber před 10 roky
rodič
revize
c8be128e97
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4
    1
      searx/engines/startpage.py

+ 4
- 1
searx/engines/startpage.py Zobrazit soubor

@@ -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):