Fix peers endpoint: use /api/v2/sync/torrentPeers instead of /api/v2/torrents/peers

This commit is contained in:
ewen 2026-05-11 00:30:58 +02:00
parent b78e876e5a
commit f4b3f20602

View file

@ -369,7 +369,7 @@ impl QbittorrentClient {
/// Fetch peers for a given torrent hash.
pub async fn get_torrent_peers(&self, hash: &str) -> Result<Vec<Peer>> {
self.require_auth()?;
let url = format!("{}/api/v2/torrents/peers?hash={}", self.base_url, hash);
let url = format!("{}/api/v2/sync/torrentPeers?hash={}&rid=0", self.base_url, hash);
let resp = self.client.get(&url).send().await?;
if !resp.status().is_success() {