Failed downloads

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
teeedubb
Newbie
Newbie
Posts: 7
Joined: February 10th, 2013, 3:07 am

Failed downloads

Post 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.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Failed downloads

Post 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
teeedubb
Newbie
Newbie
Posts: 7
Joined: February 10th, 2013, 3:07 am

Re: Failed downloads

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Failed downloads

Post 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.
teeedubb
Newbie
Newbie
Posts: 7
Joined: February 10th, 2013, 3:07 am

Re: Failed downloads

Post by teeedubb »

Thanks shypike, gonna give it a go now.
teeedubb
Newbie
Newbie
Posts: 7
Joined: February 10th, 2013, 3:07 am

Re: Failed downloads

Post 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.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Failed downloads

Post by sander »

So same experience as I have. Hopefully Shypike can shine some light on this ...
teeedubb
Newbie
Newbie
Posts: 7
Joined: February 10th, 2013, 3:07 am

Re: Failed downloads

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Failed downloads

Post by shypike »

It's on my to-check list, but you'll have to have some patience.
teeedubb
Newbie
Newbie
Posts: 7
Joined: February 10th, 2013, 3:07 am

Re: Failed downloads

Post 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.
teeedubb
Newbie
Newbie
Posts: 7
Joined: February 10th, 2013, 3:07 am

[SOLVED] Failed downloads

Post 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 :)
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: [SOLVED] Failed downloads

Post by sander »

teeedubb wrote: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 :)
Cool; it works for me too.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Failed downloads

Post 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.
rusk
Newbie
Newbie
Posts: 1
Joined: February 16th, 2014, 4:13 am

Re: Failed downloads

Post 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?
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Failed downloads

Post by shypike »

You're using the wrong URL, it should be:
curl -v 'http://localhost:8080/sabnzbd/api?apike ... el_files=1'
Post Reply