Page 1 of 1

Api - remove nzb and delete files

Posted: February 13th, 2012, 4:19 am
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

Re: Api - remove nzb and delete files

Posted: February 13th, 2012, 7:43 am
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).

Re: Api - remove nzb and delete files

Posted: April 7th, 2012, 1:19 pm
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.

Re: Api - remove nzb and delete files

Posted: April 7th, 2012, 2:42 pm
by shypike
"Delete files" only works for failed items.
Files of successful items will not be removed.

Re: Api - remove nzb and delete files

Posted: April 9th, 2012, 5:29 am
by qonstrukt
Ok, it was a failed download because the files were encrypted, so it doesn't remove the files in that case?

Re: Api - remove nzb and delete files

Posted: April 9th, 2012, 12:25 pm
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

Re: Api - remove nzb and delete files

Posted: April 10th, 2012, 2:47 am
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.

Re: Api - remove nzb and delete files

Posted: April 10th, 2012, 1:57 pm
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. :)