NZBGet is a lightweight Usenet downloader that can be installed on your Raspberry Pi. It is easy to use and can download files from the internet quickly and easily. To install NZBGet, you will first need to install Python and the GPIO library. Then, you will need to create a file called config.py in your Pi’s home directory. This file contains the following:
config.py # import nzbget from time import sleep # import os from random import randint # class NzbgetConfig (object): def init (self, name, user_agent, password): self .name = name self .user_agent = user_agent self .password = password def start (self): if not os.path.exists(self .name): os.mkdir(self .name) if not os.path.exists(self .user_agent): self .user_agent = “nzbget” elif not os.path.exists(self .password): self .password = “nzbget” else : try : nzbget = nzbget._new() except Exception as e: print("%s could not be imported: %s" % (e, sys._exc_info().class)) sys._exit(1) finally : if not nzbget: print("%s could not be started: %s" % (self .name, e)) sys._exit(1)
The first line of this file sets up the environment forNZBGet and then defines the class that will contain all of its functionality. The second line of this file sets up some basic settings for NZBGet such as its user agent and password preferences; these are used in later lines of code to configure it more specifically for downloading files on your Raspberry Pi! The last line of this file sets up an instance of NZBGet so
We recently showed you how to turn your Raspberry Pi into an always on Usenet machine centered around the feature-rich SABnzbd Usenet client. Now we’re back to show you how to use NZBGet, a more Spartan but also very lightweight Usenet tool.
Why Do I Want To Do This?
If you followed along with our How to Turn a Raspberry Pi into an Always-On Usenet Machine and you’re perfectly happy with the results, then you can skip this tutorial altogether.
If, on the other hand, you’ve found that resource-intensive SABnzbd is taxing your Raspberry Pi too much (especially if you’re running it side-by-side with a BitTorrent client), then switching to NZBGet is a great way to free up system resources. You’ll lose a variety of features in the process, but the core functionality (importing NZB files, downloading content, unpacking it, and interacting with helper apps like SickBeard and CouchPotato) is all still available with NZBGet.
Be forewarned, however, that installing NZBget is a significantly bigger hassle (and involves compiling both NZBget and patched helper apps).
What Do I Need?
For this tutorial, we assume that you have a functional Raspberry Pi with Raspbian installed and have followed along with our previous tutorials. I have you have and you’re just here to swap out SABnzbd for NZBget, jump to the next section. If you’re brand new to the process and want to get on board, we suggest starting with the following articles in the order we have them listed here:
The HTG Guide to Getting Started with Raspberry Pi How to Configure Your Raspberry Pi for Remote Shell, Desktop, and File Transfer How to Turn a Raspberry Pi into a Low-Power Network Storage Device
Everything in the first tutorial is necessary, the second tutorial is optional (but remote access is incredibly handy for this project as a download box is a perfect candidate for a headless build), and the most important part of the third tutorial is simply setting up the hard drive and configuring it to auto-mount on boot.
In addition to the prior reading list, if you’re not overly familiar with the ins and outs of Usenet, we strongly suggest reading the following tutorial:
The How-To Geek Guide to Getting Started with Usenet
If you’re already familiar with Usenet and have an account with a reliable Usenet provider, that’s awesome. If you don’t have a Usenet account, you absolutely need to read our guide to get up to speed. Unlike torrents where you can get by hopping from public tracker to public tracker, there’s no such thing as a reliable and free public Usenet server. You’ll need to get an account from a reliable provider–see our guide for general information about Usenet and tips on which providers to consider.
Updating Apt-Get and Installing UNRAR
Note: If you recently followed along with the SABnzbd guide, you can safely skip this entire section as you’ve already updated your apt-get tool and installed UNRAR.
The first order of business is to update and upgrade your apt-get installer. If you followed along with one of our other Raspberry Pi guides and updated everything, you can skip this step.
At the terminal, enter the following commands:
If you haven’t updated/upgraded in a while, be prepared to wait out a lengthy upgrade process.
sudo apt-get upgrade
Just like with the SABnzbd installation tutorial, we’ll need to install a supplemental tool to handle file archives.
In order to automate the file unpacking, we’re going to have to build a copy of the free but unintuitively named unrar-nonfree app. Fortunately, a helpful soul at the RaspberryPi.StackExchange outlined just how to do so for Raspbian.
At the terminal, enter the following command to allow you to edit your sources.list and add the repository that contains unrar-nonfree:
In nano, add the following line to the .list file:
Press CTRL+X to exit nano and Y to save/overwrite the old .list file. Back at the command prompt, you will need to update your sources list for the change to take effect:
After the update is finished (it should be pretty snappy if you updated earlier in the tutorial), it’s time to create a working directory and then move to it:
Time to download unrar-nonfree’s dependencies:
When the process finishes and you’re back at the prompt, enter the following command to download the source code and build the installation package:
Now it’s time to install the package. If you’re following this tutorial after a new version of unrar-nonfree is released, you’ll need to update the filename. You can check the version number by typing “ls” at the command prompt to list the files we downloaded in the previous steps:
Once the installation is complete, you can quickly test to see if command “unrar” is available to the system by simply typing “unrar” at the command prompt. If properly installed, the unrar app will shoot back a list of all the available switches and their descriptions. If the package installed without error, you can tidy up after yourself with the following command:
Now that we have our UNRAR app installed, it’s time to get down to the business of installing and configuring NZBGet.
Installing and Configuring NZBget
Unlike the SABnzbd installation process, this one is significantly longer/more fiddly, so be ready to spend a bit of time at the prompt. In addition to spending a bit more time at the prompt, be prepared for some downtime when using the “make” command to compile apps.
The first order of business is to make a temporary directory, like we did with our UNRAR installation, in which to work. Just like with UNRAR, we’re going to have to get our hands dirty building an installer. At the prompt, enter the following commands:
Now we need to download and extract NZBget. As of this writing, the stable release is version 10.2. Check the NZBget web site to make sure you’re downloading the most current stable version.
Since NZBGet doesn’t have a nice prepackaged installer for us, we’re going to need to manually install all the dependencies. If you’re curious what each dependency is for, check out the prerequisites list here. At the prompt, enter the following commands:
After you’ve installed all the dependencies, we need to perform a small patch operation on libpar2. You can technically skip this patch but the patch allows you to set a time limit on the par-repair process. This is used for slower devices like our little Raspberry Pi download box.
Note: if you don’t patch the files, you’ll get an error during the configuration process unless you append the ./configure command with –disable-libpar2-bugfixes-check
To patch libar2 enter the following commands at the prompt:
Now it’s time to compile and install NZBget:
Once that process is complete, we have one more task before we configure NZBget. We need to create a set of directories for NZBget to use. We’re assuming you’re using the same directory structure we’ve been using throughout our Raspberry Pi tutorials. If not, you need to modify your directories accordingly.
At the command prompt, enter the following commands to create your NZBget directories:
You can change the naming structure, but then you also have to go through the configuration files and change all the default folder names (which isn’t really worth the hassle).
Once you’ve created the folders, it’s time to edit the NZBget configuration file. At the prompt, enter the following command:
The configuration file is heavily annotated with helpful comments (but we’re not going to include all the comment lines in our instructions here because it would make the blocks of text unnecessarily long); read down through the file carefully to edit the following portion of the configuration file in the ### PATHS section:
In the ### NEWS-SERVERS section enter your Usenet Server login credentials:
Once you finish editing the file, hit CTRL+X and save. Before we launch NZBget, we have one small batch of files to copy. Back at the command prompt, enter the following command:
This copies all the post processing scripts from our temporary installation folder to the permanent post processing folder. Now we can launch NZBget daemon and make sure everything is working OK. Enter the following command:
You can now navigate to the IP address of your Raspberry Pi with the following port number:
to check out the WebUI for NZBget. The default username is “nzbget” and the default password is “tegbzn6789”.
We won’t be spending much time here, just long enough to poke around and make sure everything is running properly. (Once we’ve finished with the NZBget configuration and start-at-boot process, you won’t look at NZBget much anymore as it will be called by all your helper applications such as SickBeard and CouchPotato).
While we’re here, take a moment to add an NZB file–if you’re for want of an NZB file, head over to binsearch.info and look for your favorite Linux distribution.
Once you’ve confirmed that you can start up NZBget and download a file, it’s time to configure NZBget to start at boot. If you’ve been following along with all of our Raspberry Pi tutorials (or are a Linux veteran), this whole process will seem quite familiar.
Enter the following command at the command prompt:
Within the file, paste the following code:
Press CTRL+X, save your work, and exit nano. Now we need to change the permissions on the file and update the rc.d. Enter the following commands at the prompt:
Reboot your system and confirm that NZBget starts automatically.
At this point, you’re ready to go with a simple NZBget installation. The next step is to head over to our automation guide, How to Automate Your Always-On Raspberry Pi Download Box, and follow along with the installation instructions. Every tool we use in the guide with SABnzbd is also compatible with NZBget, so just make the appropriate substitutions in the settings menus.