瀏覽代碼

[fix] yahoo engines: parse_url doesn't throw an exception with not tracking URL

Dalf 10 年之前
父節點
當前提交
a4ffeddce1
共有 1 個檔案被更改,包括 5 行新增3 行删除
  1. 5
    3
      searx/engines/yahoo.py

+ 5
- 3
searx/engines/yahoo.py 查看文件

40
         if endpos > -1:
40
         if endpos > -1:
41
             endpositions.append(endpos)
41
             endpositions.append(endpos)
42
 
42
 
43
-    end = min(endpositions)
44
-
45
-    return unquote(url_string[start:end])
43
+    if start==0 or len(endpositions) == 0:
44
+        return url_string        
45
+    else:
46
+        end = min(endpositions)
47
+        return unquote(url_string[start:end])
46
 
48
 
47
 
49
 
48
 # do search-request
50
 # do search-request