Setup sabnzbd

From WikiDLXTV
Revision as of 21:43, 13 December 2011 by Spazlon (Talk | contribs)

Jump to: navigation, search

SABnzbd is an Open Source Binary Newsreader written in Python.

What is SABnzbd?

SABnzbd[1] is an Open Source Binary Newsreader written in Python.

It's totally free, incredibly easy to use, and works practically everywhere.

SABnzbd makes Usenet[2] as simple and streamlined as possible by automating everything we can. All you have to do is add an .nzb. SABnzbd takes over from there, where it will be automatically downloaded, verified, repaired, extracted and filed away with zero human interaction.

Installation

Prerequisites

  • b-rad's opt.bin[3] (Not jaromil's[forum.wdlxtv.com/viewtopic.php?f=40&t=2637]
  • A USB drive

Setup

  1. SSH into your WDTV and navigate to the root of your USB drive. (ie. /tmp/media/usb/USB1/49dke83hdkj482/)
  2. Download and extract Optware, then reboot:
    # wget http://b-rad.cc/binaries/opt.bin.tgz && tar -zxvf opt.bin.tgz && reboot
  3. After the WDTV reboots, SSH in again.
  4. Update Optware, install SABnzb+ and its dependencies: (this could take a while)
    # ipkg update && ipkg install sabnzbdplus python26 py26-cheetah py26-openssl screen unrar
  5. Download and extract the newest SABnzb:
    # cd /opt/share/SABnzbd && wget http://sourceforge.net/projects/sabnzbdplus/files/sabnzbdplus/sabnzbd-0.6.10/SABnzbd-0.6.10-src.tar.gz/download && tar -zxvf SABnzbd-0.6.10-src.tar.gz && rm SABnzbd-0.6.10-src.tar.gz
  6. Rename conflicting library:
    # mv /opt/lib/python2.6/lib-dynload/_locale.so /opt/lib/python2.6/lib-dynload/_locale.so.bak
  7. Reboot:
    # reboot
  8. After the WDTV reboots, SSH in again.
  9. Start SABnzb for the first time in a screen (this will take a few seconds):
    screen /opt/bin/python2.6 /opt/share/SABnzbd/SABnzbd.py -s 0.0.0.0:8080 -f /opt/share/SABnzbd/sabnzbd.ini -b 0 -l 2 -w 1 --log-all
  10. SABnzbd is now running in a screen on your WDTV. On a PC navigate to http://<wdtv ip>:8080/sabnzbd. A wizard will launch and allow you to complete the SABnzbd setup.
  11. After you complete the setup wizard you will need to restart SABnzbd. Press CTRL+C in SSH to stop SABnzbd. Press the up arrow (or reenter the last command) to start it again.
  12. Load SABnzbd on your PC again.
* SABnzbd is now running on your WDTV in a screen. If you want to continue to run it in the background press CTRL+A, then CRTL+D. This will leave the screen and bring you back to your original SSH session. To go back to the SABnzbd screen, use screen -r.

Autostart

If this was a success, you might be interested in getting SABnzdplus to launch automatically at boot. This is done by creating a script and placing it in /opt/etc/init.d/. Here's how my script looks. Adjust according to IP, paths, user/pass etc.

#!/opt/bin/bash
case "$1" in
start)
  echo "Starting SABnzbd."
  /opt/bin/python2.6 /opt/share/SABnzbd/SABnzbd.py -f /opt/share/SABnzbd/sabnzbd.ini -d
;;
stop)
  echo "Shutting down SABnzbd."
  wget -q --delete-after "http://localhost:8080/sabnzbd/api?mode=shutdown&ma_username=[USER]&ma_password=[PASS]&apikey=[APIKEY]"
;;
*)
  echo "Usage: $0 {start|stop}"
  exit 1
;;
esac
exit 0


Just save it as "S##SABnzbd", the # being a numeric value between 0 and 9 in accordance with WDLXTV's execution order (thanks b-rad). For instance, the name "S89SABnzbd" works for me. Remember to place the file in /opt/etc/init.d/, locate it using telnet/ssh and use the following command to get it executable:

chmod +x S89SABnzbd


Now everything left for you to do is configuring SABnzdplus. Enjoy

/ch1ptune

taken from: Wdlxtv Forum

High-Speed Tweaks

Try to use python2.5 instead of python2.6, seems like python2.5 is a little bit faster.

Set the article cache in Config -> General. This will keep articles in memory and not write them to disk (which is slower). Try 50M or 70M (the M denotes megabytes and is required). Keep in mind that wdtv has not much free memory! 50M seems to be a good value.

Make sure python-yenc is installed (yenc-0.3.tar.gz or higher). This will speed up decoding as it will use C code instead of python code. The logging will say at startup whether this module has been installed. It will be installed with python2.5. It seems there is no package for python2.6.

Lower your connection count in Config -> Servers. Good values are 3-6 connections.

It seems like max speed with sabnzbd on wdtv is around 2 Mbit/s!

Troubleshooting

If you get "Segmentation fault" try the following: Start sabnzb with "-v" (verbose).

/opt/bin/python2.6 /opt/share/SABnzbd/SABnzbd.py -f /opt/share/SABnzbd/sabnzbd.ini -d -v

Then you see the lib that is causing the error. Should be perl/lib/xxxx.so. Just rename the file and start sabnzbd again.

(I don't know who wrote the above, but it didn't work for me. If it doesn't work for anybody else, please remove it. - spazlon)

For anything specific to SABnzb please refer to their various options for support:

What's Next?

Get a usenet account

SABnzb isn't much use without a usenet account. Most people use something like GigaNews, but there are alternatives out there depending on your needs. Here are a few I have found, feel free to add anything you recommend.

UseNet Providers
Name Price DL Retention Connections SSL Bandwidth Free Trial Notes
GigaNews[4] $17.50 Unlimited 1,225 Days 50 Yes 1Gb 14 Days Probably the most popular usenet provider. Their premium package listed here also provides a VPN and a usenet client. They have other packages, but this is the best one for the price. You also get the first month free when you sign up.
SuperNews[5] $10.00 Unlimited 1,215 Days 30 Yes 100Mb No This service is comparable to GigaNews. They have very similar specs, but SuperNews is cheaper (but doesn't have all the options like VPN service). This is the service recommended by the guys in the SABnzbd chat room.
EasyNews[6] $30.00 150GB 1,200 Days Unlimited Yes 1Gb 14 Days These guys are pretty good. I just listed the most expensive package here because it is the best value, but they have cheaper packages. The best thing about EasyNews is that they have Rollover Gigs. That means if you don't use all the bandwidth you paid for, it will roll over to the following month. See here[7] for details.
XS Usenet[8] Free Unlimited Unknown 2 Yes 1Mb Free service This is what I use. They aren't the greatest, but they are the cheapest I have found so far. With their free account you are limited to 2 connections (with SSL) and a 1Mb download. I don't know what their retention is, but they always have the newest show I am looking for. If you aren't sure if usenet is for you, try this service first.

Sign up for a NZB service