Page 1 of 1

Help using web api to delete torrent & files

Posted: Sun Oct 16, 2022 12:44 am
by ranch
Hi,
I compiled qbittorrent-nox from git (4.5.0beta1-git+698284f00). It seems to be working fine but I'm running into a problem when trying to use the web api to delete a torrent and its' files. Using the api via curl I login, get a cookie, then am able to get a torrent list. I parse out the hash to the torrent I want to delete but when I send the POST I get "HTTP/1.1 400 Bad Request". I'm executing:

Code: Select all

curl -v -i -X POST -H "Referer: http://192.168.1.10:9882" --cookie "COOKIE_HERE" "http://192.168.1.10:9882/api/v2/torrents/delete?hashes=HASH_HERE&deleteFiles=true"
Any ideas what I'm doing wrong here?

Thanks in advance for any help!

Re: Help using web api to delete torrent & files

Posted: Sun Oct 16, 2022 4:22 pm
by ranch
Fixed it by moving the data into a --data arg:

Code: Select all

curl -i -X POST -H "Referer: http://192.168.1.10:9882" --cookie "COOKIE_HERE" --data "hashes=HASH_HERE&deleteFiles=true" "http://192.168.1.10:9882/api/v2/torrents/delete"

Re: Help using web api to delete torrent & files

Posted: Sat Oct 22, 2022 10:03 am
by Peter
You can also use the Python API, I feel like its' a bit "cleaner". Your choice though.
https://pypi.org/project/qbittorrent-api/

Re: Help using web api to delete torrent & files

Posted: Sat Nov 05, 2022 6:14 am
by mathuyaar76
Technically, I believe "seeding" means to make the complete payload available. router login

picashow