Difference between revisions of "Setup sabnzbd"

From WikiDLXTV
Jump to: navigation, search
Line 48: Line 48:
 
  stop)
 
  stop)
 
   echo "Shutting down SABnzbd."
 
   echo "Shutting down SABnzbd."
   wget -q --delete-after "http://localhost:8080/sabnzbd/api?mode=shutdown&ma_username=[USER]&ma_password=[PASS]&apikey=[APIKEY]"
+
   wget -q --delete-after "<nowiki>http://localhost:8080/sabnzbd/api?mode=shutdown&ma_username=[USER]&ma_password=[PASS]&apikey=[APIKEY]</nowiki"
 
  ;;
 
  ;;
 
  *)
 
  *)
Line 201: Line 201:
 
stop)
 
stop)
 
   echo "Shutting down SickBeard."
 
   echo "Shutting down SickBeard."
   wget -O - -q --delete-after --user=USERNAME --password=PASSWORD "http://HOST:PORT/home/shutdown/" >/dev/null
+
   wget -O - -q --delete-after --user=USERNAME --password=PASSWORD "http://localhost:8081/home/shutdown/" >/dev/null
 
;;
 
;;
 
*)
 
*)

Revision as of 17:58, 22 December 2011

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

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 lynx
  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 -dmS SABnzbd /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 move some folders and restart SABnzbd. Press CTRL+C in SSH to stop SABnzbd.
  12. Move the cache to your HDD so you don't run out of space on the WDTV:
    mkdir /tmp/media/usb/USB1/49dke83hdkj482/.downloads/ && mv /opt/shareSABnzbd/cache /tmp/media/usb/USB1/49dke83hdkj482/.downloads
  13. Edit your sabnzbd.ini to update the new folders (edit the complete_dir, incomplete_dir and cache_dir directories):
    nano /opt/share/SABnzbd/sabnzbd.ini
  14. Start SABnzbd again.
    screen -dmS SABnzbd /opt/bin/python2.6 /opt/share/SABnzbd/SABnzbd.py
  15. Load SABnzbd on your PC again.


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]</nowiki"
 ;;
 *)
   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: [http://forum.wdlxtv.com/viewtopic.php?f=17&t=4856#p39721 Wdlxtv Forum]

== Fix Memory Usage ==

SABnzbd uses a lot of RAM. When you run SickBeard and Couch Potato along with it the WDTV can start to really slow down to the point where it is almost unusable. The way to get around this is to use a kernel that has swap support.

Here are the step to create a swap file:

# Download this kernel from b-rad's site[http://b-rad.cc/binaries/wdtvlive2.fff] (Thanks b-rad)
# Re-flash your firmware with it. This will work on any of the '''WDTV Live Plus''' firmwares. Do not use this on anything other than a Live Plus.
# Log into the WEC and on the '''Main''' tab near the bottom you will see '''Advanced:Swap'''.
# Enter then amount of space you want and click submit. (Thanks RMerlin)

== 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:
* Setup Walkthrough: http://wiki.sabnzbd.org/quick-setup
* SABnzb Wiki: http://wiki.sabnzbd.org/
* SABnzb Forums: http://forums.sabnzbd.org/
* SABnzb IRC: #sabnzbd on irc.synirc.net

= 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.

{| border="1" align="center" style="text-align:center;"
  |+
    UseNet Providers
  |-
    !Name
    !Price
    !DL
    !Retention
    !Connections
    !SSL
    !Bandwidth
    !Free Trial
    !Notes
  |-
    |[http://www.supernews.com/super-special/ SuperNews]
    |$10/mo
    |Unlimited
    |1,215 Days
    |30
    |Yes
    |100Mb
    |No
    |align="left"|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.
  |-
    |[http://www.giganews.com/signup GigaNews]
    |$17/mo
    |Unlimited
    |1,225 Days
    |50
    |Yes
    |1Gb
    |14 Days
    |align="left"|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.
  |-
    |[http://www.easynews.com/usenet-plans.html EasyNews]
    |$30/mo
    |150GB
    |1,200 Days
    |Unlimited
    |Yes
    |1Gb
    |14 Days
    |align="left"|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[http://www.easynews.com/rollover.html] for details.
  |-
    |[http://www.xsusenet.com XS Usenet]
    |Free
    |Unlimited
    |Unknown
    |2
    |Yes
    |1Mb
    |Free service
    |align="left"|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 ==

To start downloading files you need to get NZBs. These are pointers to the actual files, kind of like torrents. There are several options, but the 2 easiest are:

* [http://www.nzbmatrix.com NZB Matrix] - Here you can download up to 10 zipped NZB files per day for free. When you upload these ZIP files to SABnzbd's web interface it will begin to download the file from your usenet service. For ~$10 every 10 years ($1/yr) you get unlimited downloads, bookmarks, RSS feeds and much more.
* [http://www.newzbin.com Newzbin] - Newzbin is similar to NZB Matrix, but they charge a very small fee per NZB. Check their site for details, but I felt the price to be a bit too much for me.
* RSS Feeds - If you find a site that releases NZBs in an RSS feed, you can use [http://pipes.yahoo.com/pipes Yahoo! Pipes] to create a custom feed of only the files you want, then add that to SABnzbd in the configuration settings.

== Sickbeard ==

Sick Beard is a PVR for newsgroup users (with limited torrent support). It watches for new episodes of your favorite shows and when they are posted it downloads them, sorts and renames them, and optionally generates metadata for them. It currently supports [http://www.nzbs.org NZBs.org], [http://www.nzbmatrix.com NZBMatrix], [http://www.nzbsrus.com/ NZBs'R'Us], [http://www.newzbin.com Newzbin], [http://newshost.co.za/ Womble's Index], [http://www.nzb.su NZB.su], [http://www.tvtorrents.com TVTorrents] and [http://www.ezrss.it EZRSS] and retrieves show information from [http://www.thetvdb.com theTVDB.com] and [http://www.tvrage.com TVRage.com].

=== Installation ===

# SSH into your WDTV.
# Make a folder somewhere. I chose ''/tmp/media/usb/USB1/23LK2934KDSME/temp''. cd into that directory.
# Download the newest version of SickBeard, rename it, and extract it: <pre style="white-space: pre-wrap">wget --no-check-certificate https://github.com/midgetspy/Sick-Beard/tarball/master && mv master master.tar.gz && tar -zxvf master.tar.gz</pre>
# Move SickBeard to '''/opt/share''' ''(Your source folder may vary. '''ls''' to get the directory name)'': <pre style="white-space: pre-wrap">mkdir /opt/share/SickBeard && mv midgetspy-Sick-Beard-68c5fae /opt/share/SickBeard</pre>
# Run SickBeard in a new [[#screen-help|screen]]: <pre style="white-space: pre-wrap">screen -dmS SickBeard /opt/bin/python2.6 /opt/share/SickBeard/SickBeard.py</pre>

=== Autorun ===

<pre style="white-space: pre-wrap">
#!/opt/bin/bash
case "$1" in
start)
  echo "Starting SickBeard."
  screen -dmS SickBeard /opt/bin/python2.6 /opt/share/SickBeard/SickBeard.py
;;
stop)
  echo "Shutting down SickBeard."
  wget -O - -q --delete-after --user=USERNAME --password=PASSWORD "http://localhost:8081/home/shutdown/" >/dev/null
;;
*)
  echo "Usage: $0 {start|stop}"
  exit 1
;;
esac
exit 0
</pre>


== Couch Potato ==

CouchPotato is an automatic NZB and torrent downloader. You can keep a "movies I want"-list and it will search for NZBs/torrents of these movies every X hours. Once a movie is found, it will send it to SABnzbd or download the .nzb or .torrent to a specified directory.




I haven't tried these yet, but people in the forums have reported that it works. When I get these working I will update this. If anybody else has this working, please add your contributions!

= Tips =

*<div id="screen-help"> Screen will create a new session. If you want to continue to run the process in the background, or detach the screen, press '''CTRL+A''', then '''CRTL+D'''. This will leave the screen and bring you back to your original SSH session. To go back to your detached screen, use '''screen -r'''.</div>