SSL certificate error
On Ubuntu 14.04, the example from the README.md fails with the SSL certificate error:
File "./test1.py", line 6, in <module>
for t in Search("Game of thrones"):
File "/usr/local/lib/python2.7/dist-packages/KickassAPI.py", line 360, in __init__
self.url = SearchUrl(query, page, category, order)
File "/usr/local/lib/python2.7/dist-packages/KickassAPI.py", line 141, in __init__
self.build()
File "/usr/local/lib/python2.7/dist-packages/KickassAPI.py", line 163, in build
self.max_page = self._get_max_page(ret)
File "/usr/local/lib/python2.7/dist-packages/KickassAPI.py", line 92, in _get_max_page
html = requests.get(url).text
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 55, in get
return request('get', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 385, in send
raise SSLError(e)
requests.exceptions.SSLError: [Errno 1] _ssl.c:510: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
The probleme comes from the fact that the site kickass only use HTTPS now.
A first correction is to add : verify=False
Full explanation => http://stackoverflow.com/questions/10667960/python-requests-throwing-up-sslerror
Maybe you can use this https://github.com/certifi/python-certifi
You can also run: pip install ndg-httpsclient pyOpenSSL to fix the issue.
@Pyro699 After A LOT of fiddling, I finally make it work on my raspberry pi. To get your packages working I had to install
sudo apt-get install libffi-dev
and I do believe this was necessay, but at first it didn't worked
sudo apt-get install libxml2-dev libxslt1-dev python-dev
Hope it helps anyone who might be having the same problem. This should be updated on README.md as a requirement on the installation step.