Closed DestinyofYeet closed 9 months ago
Try request the API manually and check if the result is what you would expect (list of torrents in json).
It does work with other libraries, so I don't think the issue is on my end. Tested with https://github.com/Koro33/qbit-api-rs
Please provide more info, include qbittorrent version, qbit-rs version, and the test code you used.
Sorry, took a while.
qbit-rs = "0.3.8"
qBittorrent v4.2.5
test code:
use qbit_rs::model::{Credential, GetTorrentListArg};
use qbit_rs::Qbit;
#[tokio::main]
pub async fn main() {
let client = Qbit::new("http://192.168.0.252:8080", Credential::new("xxx", "xxx"));
client.login(true).await.unwrap();
println!("Logged in!");
let torrent_list = client.get_torrent_list(GetTorrentListArg::default()).await.unwrap();
}
Ok I know what's going on. In old version, torrents/info
(maybe other "read" endpoints) only accepts GET with url param, while in new versions we can do a post request with JSON body. I'll fix this soon.
I have fixed the bug and tested with qbittorrent v4.2.5 without problem anymore. Please upgrade qbit-rs version to 0.4 and try again.
Unfortunately, I'm now getting a
thread 'main' panicked at src/main.rs:8:30:
called `Result::unwrap()` on an `Err` value: BadResponse { explain: "Failed to extract cookie from response" }
with the same example
qbit-rs = "0.4.1"
Edit:
I'mma try to reproduce it at home, since I was using a vpn, but I don't think it should make a difference.
Another edit:
Nevermind, seems like the vpn was the issue
Calling
Results in a panick
log.txt