python-qBittorrent
python-qBittorrent copied to clipboard
API calls fails unless referrer is provided
Hi! I am trying to use this module, but it doesn't work with qBittorrent 3.3.13 on Archlinux x64. All API calls fails unless I specify referrer like this:
self.session = requests.Session()
header = {
'Referer': 'http://localhost:8080'
}
login = self.session.post(self.url+'login',
data={'username': username,
'password': password},
headers=header)
if login.text == 'Ok.':
self._is_authenticated = True
else:
return login.text
I have no experience with qBittorrent, is it my misconfiguration or is it some API update and should be fixed in this library?
python: 3.6.0 requests: 2.18.1
Sorry for the late reply. I'll try to reproduce this and let you know.
Hey, I am not able to reproduce this issue. The module works fine without the Referer header.
What do you mean when you say "failed"? What error message are you receiving?
https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-Documentation#changes
Note that as of API14, referrer is required on all API calls. (qBittorrent 3.20+)
Thanks @teejo75 I'll push a fix for his ASAP.
Did this ever get fixed?
@kmlucy It works fine for me with qb4.1.4, so presumably yes.
Stale issue message