

Save it as file size-checker.cmd and put in the scripts folder.
#Sabnzbd queue repair windows#
Not all systems have 7zip installed (it's optional for SABnzbd), so this can also be emptyĮxample of a Windows batch file that forces high priority on anything smaller than 2GB. The path to the 7z command on the system that SABnzbd uses. The path to the unzip command on the system that SABnzbd uses

The path to the unrar command on the system that SABnzbd uses The path to the MultiPar command on the system that SABnzbd uses The path to the par2 command on the system that SABnzbd uses The directory where the current SABnzbd instance is located What post-processing was activated (download/repair/unpack/delete)
#Sabnzbd queue repair password#
What was the password supplied by the NZB or the userĬurrent status (completed/failed/running) The NZB filename (after grabbing from the URL)

The name of the job in the queue and of the final folder Your script can get extra information via environment variables (return information should still be sent as plain output): Position Group to be used (in case your provider doesn't carry all groups and there are multiple groups in the NZB) nzb removed) can be used to set a password when provided in the job name / password notation

The script can refuse or accept the NZB and it can also return alternative parameters. Parameters 12 through 18 require SABnzbd version 4.0.0 or higher. nzb removed) includes the password if present, in the job name / password notation NOTE Much more information is available to scripts via environment variables, see below! PositionĬlean version of the job name (no path info and. Note that on Windows the input parameters are surrounded by quotes (e.g. Use %1 in Windows scripts and $1 in Unix scripts.
#Sabnzbd queue repair code#
If the script has an exit code other than 0, script failure is assumed and the NZB accepted without changes.Īll parameters (except 1) can be empty, meaning a default value. The script must write results to the console.Įxit code 0 will make SABnzbd inspect the returned output. Once everything is in place, the Pre-Queue Script can be set in Config->Switches. On Windows, the requirement is that the script's extension is listed in your system's PATHEXT environment variable. On Unix-like operating systems (Linux, BSD, etc.) this means the x-bit must be on. All scripts must be located in the Scripts-directory, specified in Config->Folders and must be executable. Scripts may use any scripting language available on your system common choices are Python, Unix shell, and Windows batch scripts. This script determines whether the NZB should be accepted and can modify a number of job parameters. You can choose to let SABnzbd run a script just before an NZB enters the queue.
