SabNZBd is an Open Source binary news reader written in python. It has a nice web interface to manage your downloads and there are a bunch of plugins available for different browsers to make downloading from usenet even more of a breeze. Because it’s written in python, it runs practically everywhere. But for OpenSuse we need a few dependencies, hence this article.
We start with downloading the python source of SabNZBd. From our OpenSuse box we create a new ‘downloads’ directory to hold our files. The download itself we’ll do with wget.
At the time of writing, the latest SabNZBd version is 0.5.6. If you need another version check the site to grab a link to the latest version. We use the following command to download :
mkdir -p /downloads cd /downloads wget http://sourceforge.net/projects/sabnzbdplus/files/sabnzbdplus/sabnzbd-0.5.6/SABnzbd-0.5.6-src.tar.gz/download
Now we need to unpack the tarball and copy the source to the directory we want to place it in. Be sure to adjust the commands for your version of SabNZBd if it’s different from the one used here.
mkdir -p /opt/SabNZBd tar -xzf SABnzbd-0.5.6-src.tar.gz cd SABnzbd-0.5.6 cp -R * /opt/SabNZBd
Now we have installed SabNZBd, but to make it work we need to install a few dependencies. We need to get a few utilities, like ; unrar,unzip,etc. Also, we can get one of the needed python modules through zypper. For the other modules we’ll use setuptools to make it easier for you.
zypper in python-setuptools python-openssl unrar unzip
Now that we have those installed, we’ll use setuptools to install the ‘Cheetah’ module.
easy_install Cheetah
Next on our list is installing the yEnc module. This requires us to download the source and run the installer.
cd /downloads wget http://www.golug.it/pub/yenc/yenc-0.3.tar.gz tar -xzf yenc-0.3.tar.gz cd yenc-0.3 python setup.py install
Now the final thing we need is the par2cmdline binary. We could compile it ourselves, but why bother when we can get a binary
cd /downloads wget http://sourceforge.net/projects/parchive/files/par2cmdline/0.4/par2cmdline-0.4-amd64-Opteron-x86-Linux-2.4.21-SUSE-8.tar.gz/download tar -xzf par2cmdline-0.4-amd64-Opteron-x86-Linux-2.4.21-SUSE-8.tar.gz cp par2 /usr/bin
That’s it. Now we can run SabNZBd in daemon mode.
cd /opt/SabNZBd ./SABnzbd.py -d
Now the SabNZBd server will be running on the local machine on port 8080. Open up your favorite webbrowser and go to the url :
http://ip or dns of the server:8080
You will be presented with the setup wizzard
Just choose your preferred language and click next to continue with the wizzard. Special attention needs to be payed to step 2 of the wizzard. Although you would like to select the option to be able to use SabNZBd from any computer, you should probably select “I want SABnzbd to be viewable from my pc only”. There seems to be a bug in this version which makes the wizzard crash on the final step if you don’t select this option. Don’t worry, even when selecting this option you can still access it remotely without any additional steps.
After you’ve gone through the wizzard you can access your system on the same URL and be presented with the SabNZBd interface you selected.
Now that everything is up and running, we can delete the download directory.
rm -rf /downloads
Finally, it would be nice if we could have SabNZBd startup whenever this machine boots. For this we can make a simple startup script in /etc/init.d
#!/bin/sh case "$1" in start) echo "Starting SABnzbd." /opt/SabNZBd/SABnzbd.py -d -f /opt/SabNZBd/sabnzbd.ini ;; stop) echo "Shutting down SABnzbd." /usr/bin/wget -q --delete-after \"http://ip or dns:8080/sabnzbd/api?mode=shutdown&ma_username=myuser&ma_password=mypassword&apikey=myapikey" ;; *) echo "Usage: $0 {start|stop}" exit 1 esac exit 0
Copy this text into a file called sabnzbd and place the file in /etc/init.d .Make sure to adjust to your environment by changing the ip,username,password and api-key in the script. You can get the API key from the config screen of your SabNZBd installation.
Finally, you need to make this script executable and make sure it runs on startup.
chmod ugo+x /etc/init.d/sabnzbd chkconfig sabnzbd on
Now you’re done. Happy downloading