on master help sign in
[fix] kickass engine : change the hostname to kickass.to (since kickass.so doesn't respond).

Close #197 perhaps not in clean way. Explaination : In fact 301 responses are followed, except the hook is called for each HTTP response, the first time for the HTTP 301 response then for HTTP 200 response. Since the kickass engine excepts a real result, the engine crashes, AND the requests lib stops here. Add a simple test at the begining of the result function allows pass the first response and handle correctly the second response (the real one) May be a proper way is to add this test in search.py ? Code inside requests : https://github.com/kennethreitz/requests/blob/53d02381e22436b6d0757eb305eb1a960f82d361/requests/sessions.py#L579 and line 591

commit1cf870c02447a636d8b21057934e69afd5289ba2 authordalf <alex@al-f.net> dateThu 12 Feb 2015, 12:30 (12 years ago) parentf8a5f7d
1 file changed+4−1
searx/engines/kickass.py+4−1
searx/engines/kickass.py+4−1
@@ -20,7 +20,7 @@ categories = ['videos', 'music', 'files']
2020paging = True
2121
2222# search-url
23−url = 'https://kickass.so/'
23+url = 'https://kickass.to/'
2424search_url = url + 'search/{search_term}/{pageno}/'
2525
2626# specific xpath variables
@@ -45,6 +45,9 @@ def request(query, params):
4545def response(resp):
4646 results = []
4747
48+ if resp.is_redirect:
49+ return results
50+
4851 dom = html.fromstring(resp.text)
4952
5053 search_res = dom.xpath('//table[@class="data"]//tr')