Api - remove nzb and delete files

Want something added? Ask for it here.
Post Reply
danfozzy
Jr. Member
Jr. Member
Posts: 77
Joined: November 25th, 2011, 5:32 am

Api - remove nzb and delete files

Post by danfozzy »

Is there any chance that this could be added to the api, as there is a permission snag if you just "remove nzb" with the left over files
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Api - remove nzb and delete files

Post by shypike »

It's already in the api.
Just add &del_files=1 to the call.
(The docs are outdated, we're working on better ones).
User avatar
qonstrukt
Newbie
Newbie
Posts: 40
Joined: December 6th, 2011, 6:35 am
Location: Eindhoven, Netherlands
Contact:

Re: Api - remove nzb and delete files

Post by qonstrukt »

I tried this today, but it didn't seem to remove any files. It did still remove the NZB from history though, and deleting files from the web interface does work for me.

I'm using the API of SABnzbd 0.6.15.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Api - remove nzb and delete files

Post by shypike »

"Delete files" only works for failed items.
Files of successful items will not be removed.
User avatar
qonstrukt
Newbie
Newbie
Posts: 40
Joined: December 6th, 2011, 6:35 am
Location: Eindhoven, Netherlands
Contact:

Re: Api - remove nzb and delete files

Post by qonstrukt »

Ok, it was a failed download because the files were encrypted, so it doesn't remove the files in that case?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Api - remove nzb and delete files

Post by shypike »

It should delete any failed job and the files (assuming you ask for that).
It works when I test it.

This is the proper URL:

Code: Select all

http://localhost:8080/sabnzbd/api?apikey=APIKEY&mode=history&value=SABnzbd_nzo_dz_qgg&name=delete&del_files=1
or as a curl call:

Code: Select all

curl http://localhost:8080/sabnzbd/api -F apikey=APIKEY -F mode=history -F value=SABnzbd_nzo_dz_qgg -F name=delete -F del_files=1
BTW: an encrypted item that is auto-paused in the queue must be delete with another call:

Code: Select all

http://localhost:8080/sabnzbd/api?apikey=APIKEY&mode=queue&value=SABnzbd_nzo_dz_qgg&name=delete&del_files=1
User avatar
qonstrukt
Newbie
Newbie
Posts: 40
Joined: December 6th, 2011, 6:35 am
Location: Eindhoven, Netherlands
Contact:

Re: Api - remove nzb and delete files

Post by qonstrukt »

That is in my memory how I implemented it, but I'll look up the exact URL's later today and perform some more tests.
User avatar
qonstrukt
Newbie
Newbie
Posts: 40
Joined: December 6th, 2011, 6:35 am
Location: Eindhoven, Netherlands
Contact:

Re: Api - remove nzb and delete files

Post by qonstrukt »

Just tested again, and it does indeed work, but I was looking at a same named folder in my 'complete' folder instead of my 'incomplete' folder... doh! Bedankt voor je tijd. :)
Post Reply