Help using web api to delete torrent & files

Other platforms, generic questions.
Post Reply
ranch

Help using web api to delete torrent & files

Post 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!
ranch

Re: Help using web api to delete torrent & files

Post 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"
User avatar
Peter
Administrator
Administrator
Posts: 2693
Joined: Wed Jul 07, 2010 6:14 pm

Re: Help using web api to delete torrent & files

Post 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/
mathuyaar76

Re: Help using web api to delete torrent & files

Post by mathuyaar76 »

Technically, I believe "seeding" means to make the complete payload available. router login

picashow
Post Reply