Install NZBGet on Banana Pi with Raspbian or Bananian

banana-pi-nzbgetNZBGet is a lightweight usenet downloader recently updated to 14.2. NZBGet and the Banana Pi fit well, even though it is more powerful than the Raspberry Pi, it is still best to put a lightweight downloader on it. The Banana Pi is a capable little board and NZBGet runs well on low spec hardware. This will eventually be in my upcoming Ultimate Banana Pi Media Server Guide. I recommend a UsenetServer account for downloading from usenet. I tested this several times on a fresh Raspbian image from December 2014 and Bananian (images here).

Pi Unit
Processor
RAM
RAM Bus
Network
WiFi
USB
SATA
Cost
Raspberry Pi 3
1.2 GHz ARMv8
Quad Core
1 GB DDR2
450 MHz
100 Mbit
Yes
4
No
$35
Raspberry Pi 2
900 MHz ARMv7
Quad Core
1 GB DDR2
450 MHz
100 Mbit
No
4
No
$35.00
Raspberry Pi
700 MHz ARMv6
Single Core
512 MB SDRAM
400 MHz
100 Mbit
No
4
No
$25
Banana Pi
1 GHz ARMv7
Dual Core
1 GB DDR3
432 MHz
Gigabit
No
2
Yes
$36.99
Banana Pi Pro
1 GHz ARMv7
Dual Core
1 GB DDR3
432 MHz
Gigabit
Yes
2
Yes
$45.00

Install Latest NZBGet Banana Pi

Update and upgrade

sudo apt-get update
sudo apt-get upgrade -y

Download the latest NZBGet installer linux, copy all 3 lines and paste them.

wget -O - http://nzbget.net/info/nzbget-version-linux.json | \
  sed -n "s/^.*stable-download.*: \"\(.*\)\".*/\1/p" | \
  wget --no-check-certificate -i - -O nzbget-latest-bin-linux.run

Run the NZBGet installer and install in the /usr/local/bin/nzbget folder

sudo sh nzbget-latest-bin-linux.run --destdir /opt/nzbget

Remove the NZBGet installer

rm nzbget-latest-bin-linux.run

Make pi the owner of the NZBGet installation folder

sudo chown -R pi:pi /opt/nzbget

Change the NZBGet daemon to run as pi using this nifty sed command to automatically replace the DaemonUsername line

sed -i "/DaemonUsername=/c\DaemonUsername=pi" /opt/nzbget/nzbget.conf

All that is left to set NZBGet to Autostart on boot and optionally install VideoSort.

Install VideoSort

Install the Videosort post processing script to have NZBGet sort your video media automatically, if you are using CouchPotato you don't necessarily need this but it is useful if you are sending video nzbs straight from your indexer to NZBGet.

Create an NZBGet scripts folder

mkdir -p /path/to/scripts && cd /path/to/scripts

Download VideoSort 5.0

wget http://sourceforge.net/projects/nzbget/files/ppscripts/videosort/videosort-ppscript-5.0.zip

Unpack the VideoSort Script

unzip videosort-ppscript-5.0.zip

Note: Your extension scripts folder is /path/to/scripts/ which you set in NZBGet Settings -> Paths -> ScriptDir
Note: For the Raspberry Pi the extra / is necessary after scripts (this may no longer be true)

Run the nzbget daemon

nzbget -D

Now try and access NZBGet at http://ip.address:6789 username:nzbget password:tegbzn6789

Autostart NZBGet on Boot

You can use an init.d script or upstart script. The upstart script is more reliable but can cause other issues.
For either of these methods your path may be /usr/bin/local if you built from source so adjust as necessary.

NZBGet init.d Script

Create the config script in the Banana Pi's home folder, replace user with the sudo user you use

sudo nano /home/user/.nzbget

Use Ctrl+W to find DaemonUsername=root and change it to your user

DaemonUsername=user

Ctrl+X, Y and Enter to save

Create the NZBGet init.d script

sudo nano /etc/init.d/nzbget

Paste this NZBGet init.d script adjust the user again

#!/bin/sh
### BEGIN INIT INFO
# Provides:          nzbget
# Required-Start:    $local_fs $network $remote_fs
# Required-Stop:     $local_fs $network $remote_fs
# Should-Start:      $NetworkManager
# Should-Stop:       $NetworkManager
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts instance of NZBGet
# Description:       starts instance of NZBGet using start-stop-daemon
### END INIT INFO
NZBGETPATH=$(which nzbget)
# Source init functions
. /lib/lsb/init-functions
# Start/stop the NZBget daemon.
#
case "$1" in
start)   echo -n "Start services: NZBget"
$NZBGETPATH -D
;;
stop)   echo -n "Stop services: NZBget"
$NZBGETPATH -Q
;;
restart)
$0 stop
$0 start
;;
*)   echo "Usage: $0 start|stop|restart"
exit 1
;;
esac
exit 0

Ctrl+X, Y and Enter to save

Make the NZBGet init.d script executable

sudo chmod +x /etc/init.d/nzbget

Update the system to start NZBGet on boot with a later boot priority level so the hard drive is mounted

sudo update-rc.d nzbget defaults 98

Reboot to test, if it will only work once the system has been up you can use a cronjob in conjunction with the init.d script.

This command adds a cronjob to start nzbget every time it boots

crontab -l | { cat; echo "@reboot nzbget -D"; } | crontab -

Scroll to the bottom for further configuration and tweaks.

If you plan to use SSL with NZBGet use this cipher RC4-MD5 recommended by hugbug the developer of this fine software.

Since the Raspberry Pi is not the strongest machine, I recommend these NZBGet performance tweaks.

Now you are ready to configure NZBGet

Usenet Provider
Backbone
Retention
Speed
Connections
VPN
Monthly
Annual
UsenetServer
UsenetServer
3199
Unlimited
30
Yes
$10
$95.40
Newshosting
Newshosting
3199
Unlimited
30
Yes
$10
$99
Frugal
Frugal
3000
Unlimited
20
No
$4.16
$50
Usenetlink
Cloudgate
2000
100 Mbit
30
No
$15
$140