Pre-queue script output

Questions and bug reports for Beta releases should be posted here.
Forum rules
Help us help you:
  • 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
Rooster242
Newbie
Newbie
Posts: 2
Joined: March 13th, 2011, 1:51 pm

Pre-queue script output

Post by Rooster242 »

I'm writing pre-queue script in python to clear up disk space before downloading. I'm outputting to the console (using the print keyword) like I would for a post-processing script.  Will I be able to see the output of the pre-queue script in the download history or should I be outputting to a log file instead?

Also, exit codes...
"If the script has an exit code other than 0, it's assumed the script failed and the NZB will be accepted.
Exit code 0 will make SABnzbd inspect the returned output."

I basically need to tell SABnzbd to either go ahead and process the NZB or don't.  0 to go ahead, -1 to stop?

Thanks for adding this feature by the way, it's just what I needed!
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Pre-queue script output

Post by shypike »

You won't see the console output in the log.
A trivial accept script for Windows is this:

Code: Select all

@echo off
echo 1
"echo 0" will refuse the NZB.
The exit code is inspected only to prevent a failing script from blocking new entries.

BTW: If your disk is full, do you really want to refuse the NZB's and therefor lose them?
You can set a threshold below which SABnzbd will automatically stop downloading.
Rooster242
Newbie
Newbie
Posts: 2
Joined: March 13th, 2011, 1:51 pm

Re: Pre-queue script output

Post by Rooster242 »

I'm writing the script to interface with XBMC. Basically it will free enough space for the new download or if no more space can be freed then send a notice to XBMC.

Now that I think about it though it would be nice if SABnzbd would queue the nzb until the user clears up enough space for the download.  I can probably accomplish this by having my script always echo 1 and and set a threshold limit in SABnzbd.  Yeah?  If the threshold is reached and the download gets auto-paused will I have to manually start the download again after I've cleared some space or will it automatically un-pause after it detects enough space for it?
Last edited by Rooster242 on March 14th, 2011, 5:48 pm, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: Pre-queue script output

Post by shypike »

What you describe will work.
Only it won't automatically resume once disk space is available again.
Post Reply