SABnzbd+ CLI shell script
Posted: July 16th, 2008, 11:15 am
Hey folks,
This is a very quick, very dirty shell script to give you some command line control over sabnzbd. It does very little error checking, but it works. It requires bash, wget, xmlstarlet, sed, awk, grep, etc.
It doesn't support using usernames/passwords to access the web interface, but you shouldn't find it too hard to add support if you need to. I'm not really planning on updating/supporting this, I just wanted to share it since it works for me and others might get some value from it.
If anyone wants to clean it up, handle errors, make it not use xmlstarlet, make it better at taking user input, please be my guest.
This is a very quick, very dirty shell script to give you some command line control over sabnzbd. It does very little error checking, but it works. It requires bash, wget, xmlstarlet, sed, awk, grep, etc.
It doesn't support using usernames/passwords to access the web interface, but you shouldn't find it too hard to add support if you need to. I'm not really planning on updating/supporting this, I just wanted to share it since it works for me and others might get some value from it.
If anyone wants to clean it up, handle errors, make it not use xmlstarlet, make it better at taking user input, please be my guest.
Code: Select all
sab - SABnzbd+ Command Line Interface
options:
-h host Connect to this host/ip (currently: localhost)
-p port Connect on this port (currently: 8080)
valid commands:
list Prints current SAB queue
force id Force-starts the specified nzb
next id Moves the specified nzb to the top of the queue
last id Moves the specified nzb to the end of the queue
up id Moves the specified nzb up in the queue
down id Moves the specified nzb down in the queue
move id position Moves the specified nzb to the specified position
dequeue id Removes the specified nzb from the queue
cancel Cancels the currently running nzb and removes it
from the queue
enqueue url [cat] Download and add the specified url to the queue,
with optional category.
enqueuenewzbin nzbid [cat] Download and add the specified newzbin id
to the queue, with optional category.
maxrate rate Changes the speed limit for SABnzbd+ to rate,
specified in KB/s
pause Pauses downloading
continue Resumes downloading
shutdown Shutdown SABnzbd+. You must specify "True" as
the second argument for this to take effect.
start Start SABnzbd+. SABPATH must be properly set in
the script for this to work.