Просмотр исходного кода

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

Dalf 10 лет назад
Родитель
Сommit
a4ffeddce1
1 измененных файлов: 5 добавлений и 3 удалений
  1. 5
    3
      searx/engines/yahoo.py

+ 5
- 3
searx/engines/yahoo.py Просмотреть файл

@@ -40,9 +40,11 @@ def parse_url(url_string):
40 40
         if endpos > -1:
41 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 50
 # do search-request