Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login fails under qBittorrent 3.1.11 #4

Closed
stumpylog opened this issue Jan 13, 2016 · 16 comments
Closed

Login fails under qBittorrent 3.1.11 #4

stumpylog opened this issue Jan 13, 2016 · 16 comments

Comments

@stumpylog
Copy link

Following the example labeled "Quick Usage Guide" results in an exception.
python-qbittorrent version: 0.1.4
qBittorrent version 3.1.11
requests version 2.8.1

Traceback:
Traceback (most recent call last):
File "./temp.py", line 13, in
torrents = qb.torrents()
File "/usr/local/lib/python2.7/dist-packages/qbittorrent/client.py", line 168, in torrents
return self._get('query/torrents', params=params)
File "/usr/local/lib/python2.7/dist-packages/qbittorrent/client.py", line 34, in _get
return self._request(endpoint, 'get', **kwargs)
File "/usr/local/lib/python2.7/dist-packages/qbittorrent/client.py", line 62, in _request
raise LoginRequired
qbittorrent.client.LoginRequired: Please login first.

The Web UI is enabled in preferences, accessible with a browser and the username/password combination works in the browser. I have also tested with different passwords, and bypassing authentication for localhost. All these have the same result.

Looking at the login code, and replicating it with requests directly,

session = requests.Session()
login = session.post('http://127.0.0.1:8080/login', data={'username': 'admin', 'password': 'admin'})
print login.status_code

results in a status code of '404'. If there's more info that would be helpful, let me know.

@v1k45
Copy link
Owner

v1k45 commented Jan 14, 2016

The api wrapper is intended to work only on versions above 3.1.x. Please try mookfist's repo.

@ryee1
Copy link

ryee1 commented Jan 15, 2016

I am using v3.1.11 qbittorrent and receiving the same issue.

Traceback (most recent call last):
File "/home/test.py", line 6, in
torrents = qb.torrents()
File "/usr/local/lib/python3.4/dist-packages/qbittorrent/client.py", line 168, in torrents
return self._get('query/torrents', params=params)
File "/usr/local/lib/python3.4/dist-packages/qbittorrent/client.py", line 34, in _get
return self._request(endpoint, 'get', **kwargs)
File "/usr/local/lib/python3.4/dist-packages/qbittorrent/client.py", line 62, in _request
raise LoginRequired
qbittorrent.client.LoginRequired: Please login first.

from qbittorrent import Client

qb = Client('http://127.0.0.1:8080')
qb.login('admin','password')

torrents = qb.torrents()

@v1k45
Copy link
Owner

v1k45 commented Jan 15, 2016

Hi @ryee1 , as said above, it won't work on 3.1.x. You either have to upgrade to latest 3.3.x or use this repo

You can get the latest version of qbittorrent on this page.

@seeker
Copy link
Contributor

seeker commented Mar 9, 2016

How about checking the api version during init and throwing an exception if it is too low (or a 404 is returned)?

@v1k45
Copy link
Owner

v1k45 commented Mar 9, 2016

@dozedoff , nice idea. I'll work on this soon :)

@eliabntt
Copy link

eliabntt commented Jun 7, 2016

Hi try
pip install python-qbittorrent --upgrade
if output says Found existing installation: requests 2.2.1 Not uninstalling requests at /usr/lib/python2.7/dist-packages, owned by OS
delete and retry first pip install python-qbittorrent --upgrade than try your code

@eliabntt
Copy link

eliabntt commented Jun 7, 2016

@v1k45 i have to attatch qb.login(us, pw) to let your program work even if i have free access from localhost

@v1k45
Copy link
Owner

v1k45 commented Jun 8, 2016

Hi @eliabntt,

Found existing installation: requests 2.2.1 Not uninstalling requests at /usr/lib/python2.7/dist-packages, owned by OS

This behavior is totally okay as PIP says that you already have all requirements installed, no need to upgrade them.

i have to attatch qb.login(us, pw) to let your program work even if i have free access from localhost

What version of qBittorrent you're using? On what platform? Does qb.login(us, pw) work for you or it throws any error/exception?

@eliabntt
Copy link

eliabntt commented Jun 8, 2016

This behavior is totally okay as PIP says that you already have all requirements installed, no need to upgrade them.

I've got the same issue yesterday and the pip update library in /usr/local/bin but the OS's ones has precedence
Anyway it work for me I've deleted that folder and than do the upgrade so all works well
Ubuntu 14.04.3 for or odroid c1+, qbittorrent 3.1.11, so it should work well as you write on first page of this report

for qBittorrent Web API (for versions above v3.1.x).

anyway I can't update on 3.3.x because no stable version for armhf were released and not stable version don't work I've tried every single method.
qb.login() seems work(I'm not 100% sure) but I have set qbittorrent to bypass login on localhost and this work on browser but not with library.

not required when 'Bypass from localhost' setting is active.

@v1k45
Copy link
Owner

v1k45 commented Jun 8, 2016

for qBittorrent Web API (for versions above v3.1.x).

This is being misinterpreted by many folks. By above 3.1.x, i mean any version that starts with 3.1 won't work. This happens because the authentication method was changed to session based after versions above 3.1.

You have to either update your qBittorrent client (the newer versions have loads of awesome features :) ) or use mookfist's version of qBittorrent python wrapper.

@eliabntt
Copy link

eliabntt commented Jun 8, 2016

It works well with your lib
Il 08/giu/2016 08:28 AM, "Vikas" notifications@github.com ha scritto:

for qBittorrent Web API (for versions above v3.1.x).

This is being misinterpreted by many folks. By above 3.1.x, i mean any
version that starts with 3.1 won't work. This happens because the
authentication method was changed to session based after versions above 3.1.

You have to either update your qBittorrent client (the newer versions have
loads of awesome features :) ) or use mookfist's version of qBittorrent
python wrapper.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AS46Juqg72ZLDfU57o2vHMVZUQjilzW5ks5qJmDxgaJpZM4HEVFh
.

@v1k45
Copy link
Owner

v1k45 commented Jun 8, 2016

Are you sure that it works? Are you able to perform other actions like extracting list of torrents, adding etc?

@eliabntt
Copy link

eliabntt commented Jun 8, 2016

I've extracted successfully my list of torrents ;)
Il 08/giu/2016 08:31 AM, "Vikas" notifications@github.com ha scritto:

Are you sure that it works? Are you able to perform other actions like
extracting list of torrents, adding etc?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AS46JqpeRou_GEWuj-pkOVXpAsKScKTRks5qJmHDgaJpZM4HEVFh
.

@eliabntt
Copy link

eliabntt commented Jun 8, 2016

I'll keep you informed
Il 08/giu/2016 08:32 AM, "Elia Bonetto" eliabntt94@gmail.com ha scritto:

I've extracted successfully my list of torrents ;)
Il 08/giu/2016 08:31 AM, "Vikas" notifications@github.com ha scritto:

Are you sure that it works? Are you able to perform other actions like
extracting list of torrents, adding etc?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AS46JqpeRou_GEWuj-pkOVXpAsKScKTRks5qJmHDgaJpZM4HEVFh
.

@v1k45
Copy link
Owner

v1k45 commented Jun 8, 2016

Thats something I wasn't expecting. I'll test the client with 3.1.11 as soon as I get time. Thanks :)

@github-actions
Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants