Open YozenPL opened 1 year ago
When you initialize your instance, does it look similar to this?
rtorrent = rTorrent(host="address", port="port", username="login", password="password")
If you give me a sample of what you're using, I can get a better idea of what might be causing it.
I used the example:
rt = rTorrent( host='my_address_here', port=443, username="my_login_here", password="my_pass_here", rpc_path='/rutorrent/plugins/httprpc/action.php' )
httprpc is working on the server as android app "Transdrone" can connect to it.
Ok I found this is the problem with xmlrpc.client as is doing "Basic auth" only.
server_url = "https://user:pass@address:443/rutorrent/plugins/httprpc/action.php"
server = xmlrpc.client.Server(server_url)
len(server.download_list("", "main"))
Gave me the same error - 401 Unauthorized.
I used the example:
rt = rTorrent( host='my_address_here', port=443, username="my_login_here", password="my_pass_here", rpc_path='/rutorrent/plugins/httprpc/action.php' )
httprpc is working on the server as android app "Transdrone" can connect to it.
Wondering if you have special characters in your username and pass that are not being encoded properly. Thus causing the auth error.
Can you try using:
import urllib.parse
username = urllib.parse.quote("username")
password = urllib.parse.quote("password")
On your username and password, then passing it into the rtorrent instance.
The only special character is "_" in login. Rest of the symbols are [a-z], [A-Z], [0-9]
The only special character is "_" in login. Rest of the symbols are [a-z], [A-Z], [0-9]
Will look into it further later when I get to a PC. I'll check the Transdrone source and see why it's working over over pythons xmlrpc.
@YozenPL
Can you give rpc_path="/RPC2"
a shot and see if that works with rt.get_torrents()
The difference between Transdrone and this script is Transdrone uses the direct "/RPC2" host server while this script leeches off rutorrents httprpc plugin "/rutorrent/plugins/httprpc/action.php", avoiding "/RPC2" setup.
Do you happen to have access to your rutorrent UI interface? I'm wondering if that action.php directory access has a different user\pass from what your using, which is causing the 401 Unauthorized error. The only way I can replicate that error is using a bad password. Besides that, it works for me using "/rutorrent/plugins/httprpc/action.php".
Script is unable to authorize on website. Login, and password are correct. I believe this is related to digest auth on website.