mirror of
https://github.com/searxng/searxng.git
synced 2024-11-26 21:01:01 +00:00
[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 :
53d02381e2/requests/sessions.py (L579)
and line 591
This commit is contained in:
parent
f8a5f7d675
commit
1cf870c024
1 changed files with 4 additions and 1 deletions
|
@ -20,7 +20,7 @@ categories = ['videos', 'music', 'files']
|
|||
paging = True
|
||||
|
||||
# search-url
|
||||
url = 'https://kickass.so/'
|
||||
url = 'https://kickass.to/'
|
||||
search_url = url + 'search/{search_term}/{pageno}/'
|
||||
|
||||
# specific xpath variables
|
||||
|
@ -45,6 +45,9 @@ def request(query, params):
|
|||
def response(resp):
|
||||
results = []
|
||||
|
||||
if resp.is_redirect:
|
||||
return results
|
||||
|
||||
dom = html.fromstring(resp.text)
|
||||
|
||||
search_res = dom.xpath('//table[@class="data"]//tr')
|
||||
|
|
Loading…
Reference in a new issue