From AwkwardTV
Jump to: navigation, search

Install NZBGet on Apple TV

NZBGet is a very efficient NZB based binary downloader and is a better choice than SABNZBd on the Apple TV due to it's much lower memory & processor usage. SABNZBd can easily use most of the Apple TVs 256MB when it is running. NZBGet isn't as user friendly as SABNZBd but once setup you can just forget about it and the optional web interface works similar to SABNZBd.

My method to install it requires Mac Ports and I do the install from Mac Tiger O/S 10.4.9 (which runs fine under VMWare Fusion) and copy the Mac Port installation (/opt/local/) to the Apple TV. It is possible, in theory, to install Mac Ports on the Apple TV but I prefer to keep the ATV as "clean" as possible.

There's an option if you want the Web front end to NZBGet, which I recommend. To do this you need to install a Web Server and PHP5. The web server of my choice is lighttpd which uses very little memory and CPU, unlike Apache.

I'll refer to Apple TV as ATV.

Step 1. Mac Ports Installation

On your Tiger Mac install Mac Ports as usual. It requires the XCode installation too so install that from the Tiger disk and update to the latest XCode version. Once installed and running OK install the following Mac Port packages:

macport> install nzbget
macport> install unrar

(and optionally if you want the nzbgetweb interface install a web server):

macport> install lighttpd 
macport> install php5 +fastcgi -apache -apache2

They should all download, compile and install without errors.

Now you have a Mac Port installation on Tiger, you need to copy the /opt/local directory to the Apple TV:

On Tiger:

sudo tar cvfpz $HOME/macport.tar.gz /opt/local

Copy macport.tar.gz to the ATV On ATV:

sudo mkdir /mnt/opt/
sudo ln -s /mnt/opt /opt
sudo tar xvfpz macport.tar.gz -C /

Then add /opt/local/bin to your PATH in $HOME/.bash_profile

Step 2. NZBGet configuration

Download the NZBGet configuration file here and rename it to ".nzbget" putting it in the frontrow $HOME. This is a sample configuration that should work OK for most setups. You need to add your Usenet server(s) and configure your relevant download directories. It also defaults to downloading only during the night, it is quite easy to configure yourself.

Download the postprocessing file (if you want automatic unrar etc) here and rename it as /Users/frontrow/bin/nzbget/ If you don't want postprocessing edit the relevant section in the ".nzbget" file.

Download the postprocessing options file here and rename it as /Users/frontrow/bin/nzbget/postprocess.conf. Edit this file to your liking.

Now setup NZBGet to automatically start when ATV boots: on ATV create/edit the file "~/Library/LaunchAgents/org.macports.nzbget.plist" putting the following contents in it:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "">
<plist version="1.0">

Then reboot your ATV, to test it is working OK. When it comes back there should be an "nzbget" process running.

sync; sync; sudo reboot

You can now test NZBGet is running by doing:

nzbget -C

Step 3. (Optional) Web Server configuration

Configure the lighttpd program by editing the file "/opt/local/etc/lighttpd/lighttpd.conf". Uncomment the line "mod_cgi". Uncomment the line "cgi.assign" to add the PHP entry so it looks like:

#### CGI module
cgi.assign                 = ( ".pl"  => "/opt/local/bin/perl",
                               ".cgi" => "/opt/local/bin/perl",
                               ".php" => "/opt/local/bin/php-cgi" )

Now install NZBGetWeb into lighttpd. Get it from (you want Extract that ZIP file into /opt/local/www/htdocs/. Change the owner of the files:

chown -R www:admin /opt/local/www/htdocs/nzbgetweb

Configure lighttpd to automatically start:

sudo ln -s /opt/local/etc/LaunchDaemons/org.macports.lighttpd/org.macports.lighttpd.plist /Library/LaunchDaemons/org.macports.lighttpd.plist
cd /Library/LaunchDaemons/
sudo launchctl load -w org.macports.lighttpd.plist

It should be running fine, you can get to the NZBGetWeb frontend at http://appletv.local/nzbgetweb