Jump to content
markus101

unRAID with SABnzbd

735 posts in this topic Last Reply

Recommended Posts

Hi all,

 

First I'd like to say thanks to every on this forum, despite not having an exact idea of was doing with unRAID I think I've managed to stumble through getting it all setup and adding in SABnzbd. Also this wouldn't be possible without unRAID in general, so thanks for that development as well.

 

Okay now into the issue(s).

 

I've got SABnzbd up and running, downloads work via NNTP (non-SSL), download is verfied with par2, but when it gets to the unRAR stage it fails, saying it was unable to unpack (works in Windows on my main BOX). Here is what is running in the GO script at start-up for the RAR portion:

 

installpkg /boot/custom/usr/share/packages/unrar-3.7.8-i486-1stc_slack12.1.tgz

 

SABnzbd doesn't complain about the lack of unRAR (does complain if I don't have par2, so I assume the same for unRAR). I've also tried to copy the unrar file from /usr/bin to to the location where SABnzbd is (/boot/custom/usr/share/packages/SABnzbd), this is where I have par2 which seem to work right.

 

Other than this issue everything is working great, even managed to have the downloads get sorted (with SABnzbd's TV Sort/Categories) to the appropriate shares (/mnt/user/Movies or /mnt/user/TV) albeit they are not extracting at this time.

 

If anyone has any suggestions or questions about my particular setup, please let me know.

 

My Go Script is as follows:

 

#!/bin/bash

# Start the Management Utility

/usr/local/sbin/emhttp &

 

 

#Install Python

installpkg /boot/custom/usr/share/packages/python-2.5.2-i486-4.tgz

installpkg /boot/custom/usr/share/packages/unrar-3.7.8-i486-1stc_slack12.1.tgz

installpkg /boot/custom/usr/share/packages/infozip-5.52-i486-2.tgz

 

#Copy Cheetah

cp -r /boot/custom/usr/share/packages/Cheetah /usr/lib/python2.5/site-packages

cp /boot/custom/usr/share/packages/cheetah /usr/bin

cp /boot/custom/usr/share/packages/cheetah-compile /usr/bin

 

#Start SABnzbd

cd /boot/custom/usr/share/packages/SABnzbd/

python SABnzbd.py -d -f /boot/custom/SABnzbd/SABnzbd.ini

 

#Start Twonky

/boot/custom/usr/share/packages/twonkymedia/twonkymedia

 

Currently this is all running in VMWare until I get an older box to get a real deployment setup on...

 

 

Thanks in advance and Merry Christmas! (Soon anwyays)

 

Mark

 

EDIT: Spelling

UPDATE: I tried running unrar from telnet I get the following error:

 

unrar: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory.

 

I've tried installing the gcc and gcc-g++ packages, but when installing the gcc-g++ package via Telnet i get "Connection to host lost" and then none of the webpages load and I have to manually reboot the server.

 

Ended up having the gcc-g++ package install, boot me from telnet, go back in and copy the libstdc++.so.6 and libstdc++.so.6.0.3 files to the "flash drive" and then setting up GO to copy then to /usr/lib on start-up.

 

Everything is now working, a little MacGyvered, but it works.

Share this post


Link to post

Update: All of the necessary files for Sabnzbd+ 0.5.0 have been collected and rolled into one package to make installation as simple as one or two commands. The package and the updated instructions can be found in this linked post http://lime-technology.com/forum/index.php?topic=2903.msg30274#msg30274. The following outdated guide is being preserved to show what it originally took to get it running.

 

First of all, thanks to markus101 for showing us this could be done. This guide has been made so the commands can be copy and pasted into Putty. Only the "go" file needs to be manually edited. I've tested these steps on a stock unraid system running 4.4 and had Sabnzbd+ up and running in minutes.

 

1. First change your directory to the agreed upon custom packages folder. If it doesn't exist we'll make them with the mkdir command. You can just copy and paste my instructions if you use this directory structure.

 

mkdir -p /boot/custom/usr/share/packages
cd /boot/custom/usr/share/packages

 

2. Download Sabnzbd+ 0.4.7, extract it, and rename the extracted folder to a simpler non-version specific name. When future versions are released, you can simply extract and overwrite the files it into this directory.

 

wget http://kent.dl.sourceforge.net/sourceforge/sabnzbdplus/SABnzbd-0.4.7-src.tar.gz
tar -xzf SABnzbd-0.4.7-src.tar.gz
mv SABnzbd-0.4.7 sabnzbd

 

3. Now you need the following supporting packages: Python, Infozip, Unrar, multi-threaded Par2, and Feedparser if you want RSS support.

Make sure you're still in /boot/custom/usr/share/packages.

 

wget http://mirrors.easynews.com/linux/slackware/slackware-current/slackware/d/python-2.5.2-i486-4.tgz
wget http://mirrors.easynews.com/linux/slackware/slackware-current/slackware/a/infozip-5.52-i486-2.tgz
wget http://www.rarlab.com/rar/unrar-3.7.8-i486-1stc_slack12.1.tgz
wget http://feedparser.googlecode.com/files/feedparser-4.1.zip
wget http://www.chuchusoft.com/par2_tbb/par2cmdline-0.4-tbb-20081005-lin32.tar.gz

 

4. You'll also need Cheetah and PyOpenSSL (if you want SSL) but they won't install without a proper development environment. Use my copies or compile them in a full Slackware distro and copy the files over. A couple lib files are also needed for unrar.

 

wget http://www.bibliognome.com/cheetah.tgz
wget http://www.bibliognome.com/pyopenssl.tgz
wget http://www.bibliognome.com/libstdc++.tgz

 

5. Extract Cheetah, PyOpenSSL, Feedparser, Par2, and Unrar libs. Then we'll move the par2 files into sabnzbd's directory.

 

tar -xzf cheetah.tgz
tar -xzf pyopenssl.tgz
tar -xzf par2cmdline-0.4-tbb-20081005-lin32.tar.gz
tar xzf libstdc++.tgz
cp libstdc++.so* /usr/lib
installpkg infozip-5.52-i486-2.tgz 
unzip feedparser-4.1.zip -d /boot/custom/usr/share/packages/feedparser-4.1
cd par2cmdline-0.4-tbb-20081005-lin32
cp par2 /boot/custom/usr/share/packages/sabnzbd
cp lib* /boot/custom/usr/share/packages/sabnzbd

 

6. Everything is now in place. We just need add the following to the startup /boot/config/go file. Replace the IP at the end with your Unraid servers. The port can also be changed from 88 if needed.

 

#Install packages and copy files for Sabnzbd
installpkg /boot/custom/usr/share/packages/python-2.5.2-i486-4.tgz
installpkg /boot/custom/usr/share/packages/infozip-5.52-i486-2.tgz
installpkg /boot/custom/usr/share/packages/unrar-3.7.8-i486-1stc_slack12.1.tgz
cp -r /boot/custom/usr/share/packages/Cheetah /usr/lib/python2.5/site-packages
cp /boot/custom/usr/share/packages/Cheetah/Cheetah-2.0.1-py2.5.egg-info /usr/lib/python2.5/
cp /boot/custom/usr/share/packages/Cheetah/bin/cheetah /usr/bin
cp /boot/custom/usr/share/packages/Cheetah/bin/cheetah-compile /usr/bin
cp -r /boot/custom/usr/share/packages/OpenSSL /usr/lib/python2.5/site-packages
cp /boot/custom/usr/share/packages/OpenSSL/pyOpenSSL-0.8-py2.5.egg-info /usr/lib/python2.5/
cp /boot/custom/usr/share/packages/sabnzbd/par2 /usr/bin
cp /boot/custom/usr/share/packages/sabnzbd/libtbb* /usr/bin
cp /boot/custom/usr/share/packages/libstdc++.so* /usr/lib

#Install Feedparser & start SABnzbd
cd /boot/custom/usr/share/packages/feedparser-4.1
python /boot/custom/usr/share/packages/feedparser-4.1/setup.py install
python /boot/custom/usr/share/packages/sabnzbd/SABnzbd.py -d -f /boot/custom/usr/share/packages/sabnzbd/SABnzbd.ini -s 192.168.1.10:88

 

7. Save the go script and reboot, or run all of those commands to proceed. Sabnzbd will start and you should now be able to access its web interface. If you used 192.168.1.10 as the ip and port 88 you would go to http://192.168.1.10:88/sabnzbd

 

The download, cache, and complete directory should be changed from the defaults on the flash drive. With a cache drive I use the following paths:

 

log_dir = /mnt/cache/.custom/sabnzbd/logs
download_dir = /mnt/cache/.custom/sabnzbd/downloads/incomplete
nzb_backup_dir = /mnt/cache/.custom/sabnzbd/backup
cache_dir = /mnt/cache/.custom/sabnzbd/cache
complete_dir = /mnt/user/Downloads

 

 

If you don't have a cache drive and put the incomplete download directory in an unraid array disk, be sure to stop downloading before ever trying to stop the array. If a disk is in use from an addon program like this it'll prevent it from unmounting, and will make the other drives appear as unformatted. If that happens stop the download or wait for the par2/extraction to finish and click stop again. The drive should then unmount and then you can shutdown or reboot as normal. It would still be a good idea to run a parity check after restarting the sever.

Share this post


Link to post

Geez... NZBget is an order of magnitude simpler.

It probably uses an order of magnitude less resources too. Sabnzbd's (PYTHON) always been a bit resource hungry but it runs out of sight in the background and does exactly what it's supposed to for over 4 years now.

 

Without the optional RSS (Feedparser) and SSL (PyOpenSSL) the install isn't bad really. It just needs python, cheetah, and what the other nzb grabbers require: infozip, unrar, and par2. Oh and maybe the two gcc lib's the OP mentioned that I forgot to include in the guide. :(

Share this post


Link to post

thank you guys very much. this is just perfect!

:) no need to run a second pc all the time. i also tried bubbaQs nzbget, but i think sabnzbd is more user friendly.

Share this post


Link to post
i also tried bubbaQs nzbget, but i think sabnzbd is more user friendly.

NZBget is a backed -- it is not supposed to be user friendly.  You use the web interface or another front end and it becomes very friendly.

Share this post


Link to post

My tv renaming problem was caused by using the windows back slashes from my old config file. Switching to foward slashes fixed it.

 

Was:

%sn\Season %0s\%sn.%0sx%0e.%en.%ext

Show Name\Season 01\Show Name.01x05.Episode Name.avi

 

Now:

%sn/Season %0s/%sn.%0sx%0e.%en.%ext

Show Name/Season 01/Show Name.01x05.Episode Name.avi

Share this post


Link to post

Thanks Romir, thats pretty much the same as I did...except I took the lazy route and downloaded/extracted everything in Windows and copied it over.

 

SAB was the only thing holding me back on setting upunRAID, but once that was sorted I started the process.

 

Again thanks Romir - you helped me sort out a few post-install issues in our conversations.

 

To everyone else - best of luck getting SAB on unRAID, if you have any questions I'll do my best to answer them, especially now that the holidays are over.

 

*EDIT* @Romir - I believe elementtree is eitehr not needed or included in some other way (best I remember from trying to get V5 of SAB running in Windows), in the same boat as you regarding yENC - no idea, but as long as cherrypy is the in SAB folder SAB knows to look there (this also applies for Cheetah according to one of the devs for SAB). Also the two GCC libs are required for unRAR - it was the only thing that was failing prior to them being installed.

 

Happy New Year,

 

Markus101

Share this post


Link to post

@Romir

 

the lib´s should be in usr/lib and not in usr/bin

and again ... thx for this guide!

 

Edit: If you need libstdc++.so files, you can copy and paste or the following. Or install the 17mb gcc-g++-4.2.4-i486-1.tgz on startup. I went through the steps on a stock 4.4 system and didn't need them, but ymmv.

 

Code:

cd /boot/custom/usr/share/packages

wget http://www.bibliognome.com/libstdc++.tgz

tar xzf libstdc++.tgz

cp libstdc++.so* /usr/lib

 

 

In your go script add: "cp /boot/custom/usr/share/packages/libstdc++.so* /usr/lib"

 

Share this post


Link to post

Hi, hope this helps. I'll also post it back into the SAB Forum for others.

 

First download the following files.

 

http://kent.dl.sourceforge.net/sourceforge/sabnzbdplus/SABnzbd-0.4.6-src.tar.gz - SABnzbd+

http://mirrors.easynews.com/linux/slackware/slackware-current/slackware/d/python-2.5.2-i486-4.tgz - Python

http://mirrors.easynews.com/linux/slackware/slackware-current/slackware/a/infozip-5.52-i486-2.tgz - Infozip

http://www.rarlab.com/rar/unrar-3.7.8-i486-1stc_slack12.1.tgz - unRAR

http://feedparser.googlecode.com/files/feedparser-4.1.zip - feedparser (for RSS Feeds)

http://www.chuchusoft.com/par2_tbb/par2cmdline-0.4-tbb-20081005-lin32.tar.gz - par2cmdline

http://www.bibliognome.com/cheetah.tgz

http://www.bibliognome.com/libstdc++.tgz

 

Create a directory on the flash drive (you con modify the structure to fit, as I didn't follow the "best practices")

My path is /boot/packages (all files are put in packages/subfolders in packages)

 

inside /boot/packages (\\unraid\flash\packages in Windows)

Extract SABnabd (I used SABnzbd as the folder name)

Copy, python, unrar, infozip to packages

Copy feedparser to packages

Copy the par2cmdline files to packages

Extract the Cheetah Folder to packages

Extract/copy over the libstdc++.so.6.0.3 and libstdc++.so.6 files to packages

 

Now you need to telnet to the unRAID server and run the following (or add to the GO script in /boot/config/go then reboot):

 

#Install python, unrar and infozip:

 

installpkg /boot/packages/python-2.5.2-i486-4.tgz

installpkg /boot/packages/unrar-3.7.8-i486-1stc_slack12.1.tgz

installpkg /boot/packages/infozip-5.52-i486-2.tgz

 

#Copy Cheetah files:

cp -r /boot/packages/Cheetah /usr/lib/python2.5/site-packages

 

#Compile feedparser:

python /boot/packages/feedparser/setup.py install

 

#Copy files for PAR2:

cp /boot/packages/par2 /usr/bin

cp /boot/packages/libtbb.so /usr/bin

cp /boot/packages/libtbb.so.2 /usr/bin

 

#Copy RAR Libraries:

cp /boot/packages/libstdc++.so.6.0.3 /usr/lib

cp /boot/packages/libstdc++.so.6 /usr/lib

 

#Start SABnzbd so it will create the default ini file.

cd /boot/packages/SABnzbd/

python SABnzbd.py -d

 

After it creates the default config file, shutdown SAB via the command line: killall python or nicely, with

/usr/bin/wget -q --delete-after "http://localhost:8080/sabnzbd/api?mode=shutdown"

 

Edit the config file /boot/packages/SABnzbd/SABnzbd.ini by default. and make changes to the IP and Port so it uses your unRAID IP and a different port than unMENU

You cna also change the default folders now, or after you go into the WebUI:

download_dir = /mnt/cache/.custom/sabnzbd/downloads/incomplete
nzb_backup_dir = /mnt/cache/.custom/sabnzbd/backup
cache_dir = /mnt/cache/.custom/sabnzbd/cache
dirscan_dir = /mnt/user/Downloads
complete_dir = /mnt/user/Downloads

 

Restart unRAID or simply run

python SABnzbd.py -d

 

Connect to the WebUI and setup the rest!

 

If you want to change the location of the SAB config run it with the following:

python SABnzbd.py -d -f /boot/SABnzbd/SABnzbd.ini

Path can be changed to anything you wish and is called with the -f.

 

I haven't included SSL, but Romir has the install steps in his post.

 

Hopefully this helps, saves you typing commands, but Romir's is very straight forward and looking at it now, it might just be easier to run it all from the command-line.

 

Thanks to Romir for hosting the Libraries for RAR and the Cheetah files, in addition to the SSL Libs.

Share this post


Link to post

This is excellent. I followed the instructions and it works perfectly. I also got a script from the SAB forums and now my Unraid box is quietly sitting in the corner, downloading any missing TV show for which I have a directory.

 

In case anyone doesn't want to read through that link: some guy wrote a python script that takes a newzbin rss feed full of TV or movies, parses it and compares it against what you already have in your directories and downloads anything you don't have that's present in the feed. So for TV, it downloads all the new episodesfor any show that you're already watched some of. And, if you want to download a new series, you just have to create the folder for it, and the script starts populating it with files :)

Share this post


Link to post

use hellavcr instead you wont regret it :)

 

Alot of this install could be scripted to help out new users if anyone is game :)

Share this post


Link to post

Downside to HellaVCR is the need to have PHP, starts increasing the size and complexity of the unRAID server, I was looking forward to HellaVCR, but maybe I'll give the Python script a go - makes getting back episodes of shows much easier.

 

http://forums.sabnzbd.org/index.php?topic=1335.0 is the script that is being referred to right?

 

*EDIT* Apparently I'm semi-slow and missed the fact that you made a link to that already.

Share this post


Link to post

For automatic rss episode downloads http://mytvnzb.foechoer.be generates a custom rss feed based on tvnzb.com files.  It's a good idea to keep the sd and x264 shows seperate, so use two feeds to avoid downloading both types of each episode.

Share this post


Link to post

Another script of interest is: http://forums.sabnzbd.org/index.php?topic=61.15 - Linux Script

http://forums.sabnzbd.org/index.php?topic=67.0 - Windows Script

It will rename files and combine multiple AVI movies into a single AVI, then move it and delete the split versions, the TV rename part isn't what I need as I use tvrename to handle the renaming (http://www.tvrename.com).

 

With some modification it should be pretty easy to use this without using Newzbin and have it run against movies only.

Share this post


Link to post

avi file renaming is evil  ;D

 

Nothing is worse than looking for a movie that the releaser decided to start with his tag and make the movie into an acronym and why manually rename when the computer will do it for you (and join those pesky two-cd AVI's).

 

Here is the code I'm using, which will also handle HD-WMV for those crippled XBox users, the code could be re-worked as currently if you move a WMV file the else statement still tries to run and throws an error. In BASH can you have multiple if statements in series before an else statement? ie. If a=1 then echo Hello World, if b=4 then echo Goodbye World, else deltree *.* (not what you want to, but you get the point).

 

#! /bin/bash
    
set -u

CATEGORY_NAME=`echo $1 | awk -F [/] '{print $(NF-1)}'`

echo $2 >> /var/log/sab_proc.log

echo "Category: $CATEGORY_NAME" >> /var/log/sab_proc.log


FOLDER_PATH="$1"
FOLDER_NAME=`echo $FOLDER_PATH | awk -F [/] '{print $NF}'`


echo "Folder Path: $FOLDER_PATH" >> /var/log/sab_proc.log

cd "$FOLDER_PATH"
####################
# Movie Processing #
####################

if [ $CATEGORY_NAME = "Movies" ]
then
# Where do you want to put the movies that this script processes?
MOVIE_DESTINATION_DIRECTORY="/mnt/user/Movies"

MOVIE_NAME=`echo $FOLDER_NAME | sed 's/ (.*)//g'`
echo "Movie Name: $MOVIE_NAME" >> /var/log/sab_proc.log

  if [ `find . -size +629145600c -regex '.*/.*\.wmv' | wc -l` -eq 1 ]
  then
  FILEZ[1]="$FOLDER_PATH`find . -size +629145600c -regex '.*/.*\.wmv' | sed 's/^\.//'`"
  #Move the wmv to the folder 
  mv "${FILEZ[1]}" "$MOVIE_DESTINATION_DIRECTORY/_HD/$MOVIE_NAME.wmv"  
  echo "$MOVIE_DESTINATION_DIRECTORY/_HD/$MOVIE_NAME.wmv" >> /var/log/sab_proc.log
  rm -r "$FOLDER_PATH"
  
  fi
  
if [ `find . -size +629145600c -regex '.*/.*\.avi' | wc -l` -eq 2 ]
	then
	FILEZ[1]="$FOLDER_PATH`find . -size +629145600c -regex '.*/.*\.avi' | sort | sed -n '1p' | sed 's/^\.//'`"
	FILEZ[2]="$FOLDER_PATH`find . -size +629145600c -regex '.*/.*\.avi' | sort | sed -n '2p' | sed 's/^\.//'`"
	echo "Joining Files..." >> /var/log/sab_proc.log
	mencoder -forceidx -ovc copy -oac copy -o "$FOLDER_PATH/$MOVIE_NAME".avi "${FILEZ[1]}" "${FILEZ[2]}"
	#Get the path for the avi 
	FILEZ[1]="$FOLDER_PATH`find . -size +629145600c -regex '.*/.*\.avi' | sed 's/^\.//'`" 
	echo "Moving Files..." >> /var/log/sab_proc.log 
	#Move the avi to the folder 
	mv "$FOLDER_PATH/$MOVIE_NAME".avi "$MOVIE_DESTINATION_DIRECTORY/$MOVIE_NAME.avi" 
	echo "$MOVIE_DESTINATION_DIRECTORY/$MOVIE_NAME.avi" >> /var/log/sab_proc.log
	rm -r "$FOLDER_PATH"  
  echo "Removing Folder: $FOLDER_NAME..." >> /var/log/sab_proc.log
	#*		growlnotify -m "Download Complete: $MOVIE_NAME" -i "avi"
else 
	#Get the path for the avi 
	FILEZ[1]="$FOLDER_PATH`find . -size +629145600c -regex '.*/.*\.avi' | sed 's/^\.//'`" 
	echo "Moving Files..." >> /var/log/sab_proc.log 
	mv "${FILEZ[1]}" "$MOVIE_DESTINATION_DIRECTORY/$MOVIE_NAME.avi" 
	echo "$MOVIE_DESTINATION_DIRECTORY/$MOVIE_NAME.avi" >> /var/log/sab_proc.log
	rm -r "$FOLDER_PATH"  

fi

fi

 

Share this post


Link to post

heres the code i use.

 

movie.nfo containing an imdb link

 

done :)

Share this post


Link to post
:( Sub-folders for every movie, yuck. I guess I'm picky (and a bit lazy with the remote), despite the script working it still bugs me that it could be better, guess I should learn some BASH scripting and fix it... Gone are the days of AutoHotKey for every script...

Share this post


Link to post

no way i could do it with one folder. samba and 5000 + avi in it is sillyness :)

 

better than renaming files so they bare no relation to the exact same file thousands of other have. :)

 

but horses for coarses burt XBMC library mode rocks

Share this post


Link to post

Markus: That TVrename program is awesome. I had been using TVScout 0.8 up to this point, but TVrename is just so much better and so much more. Also, that http://mytvnzb.foechoer.be/ site is super user-friendly. Great finds!

 

I just wish that TVRename would automatically download from newzbin any episodes for any TV show I was missing (because it lets you exclude eps/seasons, you could avoid getting 'old' eps of really long running shows (I'm looking at you SNL)). The magic button lets me lookup the shows, but it doesn't do the critical step on bookmarking/downloading the NZB. So close, yet so far....

Share this post


Link to post

Yeah, I agree. I actually got the Dev to add the initial Newsgroup Searches (when it wasn't configurable), because the program is awesome, but Torrents were too slow for my liking. He's pretty active in the forums there, although I'm not sure how easy it would be for him to integrate, but it might be worth asking.

 

I'm still using Newzbin RSS feeds and they seem to do a pretty good job - although I get lots of dupes and random shows that contain the same name:( I'll take a look at this other one, but I stopped using tvnzb because I found it slower than nzbs.org or Newzbin.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.