Page 1 of 1
Failed downloads
Posted: February 10th, 2013, 3:16 am
by teeedubb
Hey all,
Ive looked through the sabnzbd configuration and googled but I cant seem to find a answer - Is it possible to move/delete failed downloads?
In the sabnzbd webui there is a option to 'Purge failed nzb's and delete files' , is there anyway to run this after every download? Ive checked the log file after using the 'Purge failed nzb's and delete files' command to see if I could see any hints of how to acheive my goal but nothing was shown in the log file.
Any suggestions? Is this possible?
Thanks in advance.
Re: Failed downloads
Posted: February 10th, 2013, 4:01 am
by sander
If you really want it:
SABnzbd's API offers options to remove failed downloads. See
http://wiki.sabnzbd.org/api#toc41
So you can trigger that from a curl one-liner. I tried this one:
Code: Select all
curl -v 'http://localhost:8080/api?mode=history&name=delete&value=all&failed_only=1'
... but that deleted my whole history, not only failed one ... :-(
And this one didn't work either:
Code: Select all
sander@R540:~$ curl 'http://localhost:8080/api?mode=history&name=delete&failed_only=1'
error: expect one parameter
sander@R540:~$
So some experimenting is necessary.
As soon as you have the correct curl one-liner, you can put it in a post-processing script for the default category. Or you can put in a crontab entry so that it is run each x minutes.
HTH
Re: Failed downloads
Posted: February 10th, 2013, 8:13 am
by teeedubb
Thanks for your help and prompt reply sander - I now have a point to start my journey from

Time to do some reading.
Quick question, is there anyway to fail downloads on purpose? This would make testing alot easier.
Thanks again sander.
Re: Failed downloads
Posted: February 10th, 2013, 8:24 am
by shypike
teeedubb wrote:
Quick question, is there anyway to fail downloads on purpose? This would make testing alot easier.
That's easy: just set the job's priority to "Stop" after the first few files are in.
Re: Failed downloads
Posted: February 10th, 2013, 8:30 am
by teeedubb
Thanks shypike, gonna give it a go now.
Re: Failed downloads
Posted: February 10th, 2013, 9:39 am
by teeedubb
This command:
Code: Select all
curl -v 'http://localhost:8085/api?mode=history&name=delete&value=all&failed_only=1&del_files=1'
seems to delete the whole history, but will only delete the files of failed downloads. I tried a few variations but I was unable to clear only the failed history while leaving the completed history in place, but Im happy to have the the failed downloads deleted automatically.
Thanks for the help guys.
Re: Failed downloads
Posted: February 10th, 2013, 10:53 am
by sander
So same experience as I have. Hopefully Shypike can shine some light on this ...
Re: Failed downloads
Posted: February 10th, 2013, 11:26 pm
by teeedubb
I'm thinking the '&value=all' parameter is the key here, but I'm no expert. I tried replacing 'all' with 'failed_only' to no avail. I just had the idea to use 'failed'. I doubt it will work but its worth a shot. Googling this topic or the parameters I'm using isn't giving me much info.
Re: Failed downloads
Posted: February 11th, 2013, 6:11 am
by shypike
It's on my to-check list, but you'll have to have some patience.
Re: Failed downloads
Posted: February 11th, 2013, 7:34 am
by teeedubb
Thanks shypike.
While googling 'sabnzbd check api command' I can across another one of your posts which is related to this topic. (Isn't it weird that when I Google something unrelated I find what I'm after...)
http://forums.sabnzbd.org/viewtopic.php ... 44&p=77051
So it looks like the value option does need to be set to 'failed' and not failed_only and the failed_only option needs to be omitted.(apologies if I'm using the wrong terminology)
I'll test when I get home.
Thanks again.
[SOLVED] Failed downloads
Posted: February 11th, 2013, 11:27 am
by teeedubb
The command
curl -v '
http://localhost:8085/api?mode=history& ... el_files=1'
as per the link in the above post works. It only deletes failed history + files, leaving complete history + files alone.
Time to celebrate

Re: [SOLVED] Failed downloads
Posted: February 11th, 2013, 12:05 pm
by sander
Cool; it works for me too.
Re: Failed downloads
Posted: February 11th, 2013, 3:40 pm
by shypike
That's the right way.
The documentation is incorrect and I'll change it.
Also, this function is rather weird in its details, but we cannot change without breaking existing tools.
Re: Failed downloads
Posted: February 16th, 2014, 4:17 am
by rusk
When I execute that command this is what I get:
Code: Select all
# curl -v 'http://localhost:8080/api=myapikey?mode=history&name=delete&value=failed&del_files=1'
* Hostname was NOT found in DNS cache
* Trying ::1...
* Connected to localhost (::1) port 8080 (#0)
> GET /api=myapikey?mode=history&name=delete&value=failed&del_files=1 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:8080
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Date: Sun, 16 Feb 2014 09:10:33 GMT
< Content-Length: 513
< Content-Type: text/html;charset=utf-8
* Server CherryPy/3.2.0 is not blacklisted
< Server: CherryPy/3.2.0
<
<html>
<head>
<script type="text/javascript">
<!--
location.href = "http://localhost:8080/sabnzbd"
//-->
</script>
</head>
<body><br/></body>
</html>
* Connection #0 to host localhost left intact
I am running arch and installed this package 'aur/sabnzbd 0.7.16-1' .
Any ideas?
Re: Failed downloads
Posted: February 17th, 2014, 6:22 am
by shypike