From faed14b2c691746ba6cf98d164a5e6b1ca3ee4c9 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Tue, 18 Mar 2014 10:06:14 +0100 Subject: [PATCH] [fix] #55 --- searx/engines/yahoo.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/searx/engines/yahoo.py b/searx/engines/yahoo.py index 7f87e455f..c6cabb58a 100644 --- a/searx/engines/yahoo.py +++ b/searx/engines/yahoo.py @@ -17,8 +17,15 @@ paging = True def parse_url(url_string): + endings = ['/RS', '/RK'] + endpositions = [] start = url_string.find('http', url_string.find('/RU=')+1) - end = min(url_string.rfind('/RS'), url_string.rfind('/RK')) + for ending in endings: + endpos = url_string.rfind(ending) + if endpos > -1: + endpositions.append(endpos) + + end = min(endpositions) return unquote(url_string[start:end])