diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2014-03-18 10:06:14 +0100 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2014-03-18 10:06:14 +0100 |
| commit | faed14b2c691746ba6cf98d164a5e6b1ca3ee4c9 (patch) | |
| tree | 9e686a74b3399d8c139b957c5a1b5a354c8a852b | |
| parent | c14e8fe0a50d41871cea8139199b6332dadc7cdb (diff) | |
[fix] #55
| -rw-r--r-- | searx/engines/yahoo.py | 9 |
1 files changed, 8 insertions, 1 deletions
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]) |