Introduction
SABnzbd is a versatile tool written in Python specifically designed to take an NZB-File as input and then retrieve all of the content defined inside of it for you automatically. Recently there have been new improvements with SABnzbd in the past few releases. So I thought I’d share a working out of the box solution using RPMs. In addition to this, I’ve packaged up my notification script I wrote which can further enhance this great product.
SABnzbd and Usenet
First off; lets summarize Usenet for those who don’t use it or aren’t already familiar with it. In the simplest terms: Usenet is a great big fucking mess; a total disaster. It’s basically a location where literally anyone with access to it can post/upload all they want at their free will anonymously. Don’t get me wrong; this is cool too because it’s basically one very large hard drive without anyone telling you what you can and can’t place onto it. Seriously though, just consider for a second what your computer would look like if you allowed absolutely anyone who has access to the internet to upload content freely and without rules to it. You’d probably run out of hard disk space quickly; and you’ll be left with a lot of content everywhere. Well; that’s exactly what Usenet is (greatly simplified); it’s one large centralized location filled with petabytes of data. The thing with Usenet though is… it isn’t, and won’t be running out of disk space anytime soon.
The good news is, (thankfully) people sift through the heaps of information constantly being posted (onto Usenet) using automated tools regularly. These tools that do the sifting are generally known as Indexers. I talk more about this in another blog I wrote here a while back. But basically whenever an Indexer finds some useful data, it records the location as to where it was found. Indexers record this information in a special file call an NZB-File. NZB-Files are effectively treasure maps containing the coordinates on Usenet to which a specific piece of data can be located at.
It should be known that if you’re planning on posting/uploading stuff to Usenet yourself (for backup purposes or what have you), most (good) software will generate you an NZB-File afterwards allowing you to retrieve your data back again later on.
Now lets throw SABnzbd into the picture because it specifically is designed to retrieve content based on an NZB-File it’s provided. The process looks a little like this:
- Acquire NZB-File: Presumably you already have it because you’re just trying to retrieve data you posted in the past. But alternatively, the NZB-File could have also been acquired from and Indexer too.
- Give SABnzbd Access to NZB-File: You simply hand off your treasure map to the application who’s actually going to go out there and get the content for you.
This is truly the bread and butter of SABnzbd. The next set of steps identified below are all fully automated (and done behind the scenes) for you. They require nothing from you, but it’s worth explaining it for those who are interested.
- SABnzbd Establishes a Connection to Usenet: The catch with SABnzbd is it’s merely a vessel for fetching the data. You need to have provided it access to Usenet to which it will fetch this data from. Thus SABnzbd must (obviously) connect to a Usenet provider in order to retrieve data from Usenet itself. This step is put in place to make sure you’ve got yourself an account with a provider!
- SABnzbd Downloads Content: Segment by segment, each portion of your data is downloaded and re-assembled. There are lots of additional things that go on too such as making sure the data isn’t damaged and attempting to correct it (all automatic) if it is.
- SABnzbd Saves Data:If all goes well; and in most circumstances it will. You will have all of the content successfully retrieved at this point!
SABnzbd has tons of automation built into it; I’m really just focusing on the basics here to get you going.
I Want To Try It
Of course you do! So here’s the thing; if you’ve already connected to my repository here, you can get it by simply typing the following:
# Download and install SABnzbd plus the Notification Addon # on CentOS 7.x using the nuxref repositories located # here: https://nuxref.com/repo/ yum install -y --enablerepo=nuxref \ --enablerepo=nuxref-shared \ sabnzbd sabnzbd-script-notify
You can also just visit the location I host these packages directly (via my repository) here and download the RPMs for yourself:
Note: I provided the source rpms optionally; they are not required unless you want to build this for yourself from scratch.
SABnzbd Environment
It’s worth giving you a quick rundown of how the RPM installs itself upon your computer: First off, it creates a general user/group called sabnzbd. By default this is the user/group it will run as. To grant a user access to all of the content retrieved by SABnzbd, you can just add yourself to the sabnzbd group:
# as root; we can add ourselves to the sabnzbd group usermod -a -G sabnzbd myuserid # Note: if this user is logged in, they will have to log out and log # back in to have these new security credentials noticed.
You can start it up with the command:
# as root; start up SABnzbd: systemctl start sabnzbd.service
You’ll be able to access the web page through your browser by punching in https://localhost:9080.
You can set it up to survive reboots with the following command:
# as root; start up SABnzbd when the machine is first # powered on: systemctl enable sabnzbd.service
- All of your log files will show up in /var/log/sabnzbd/sabnzbd.log
- All of configuration will get written to /etc/sabnzbd/sabnzbd.conf
- All of the variable data (file processing, etc) will be located in /var/lib/sabnzbd/*. In fact this is a very important directory because unless you configure things differently, all downloaded content will appear in /var/lib/sabnzbd/complete.
Firewall Configuration
The package will provide you the files needed to set up the firewall and make SABnzbd available to you from other stations by simply doing the following:
# as root; start up SABnzbd when the machine is first # powered on (assuming your network is set up to the `home` zone firewall-cmd --zone=home --add-service sabnzbd --permanent # Now reload your firewall to take on the new change: firewall-cmd --reload
SABnzbd Notifications
SABnzbd can keep you posted on what it’s doing by sending you emails when a download completes (or fails). It can send you an notification on Pushbullet, and a few others too.
If you want to use the Notify script I wrote, you’re already almost set up and ready to go because it’s in the sabnzbd-script-notify rpm you already installed.
To enable it, you simply need to need to access the Notifications tab from within the SABnzbd Configuration section.
- Select the Enable notification script checkbox
- Select the Notify.py script from the dropdown list next to the Script category
- Next to the Parameter category, you must specify the URL(s) identifying which service(s) you want to notify.
Depending on what you want plan on alerting, the URL(s) you specify in the Parameter field will vary. You can get a better understanding of the URL options supported here.
Credit
This blog took me a very long time to put together and test! The repository hosting alone accommodates all my blog entries up to this date. If you like what you see and wish to copy and paste this HOWTO, please reference back to this blog post at the very least. Itβs really all I ask.
Special thanks to Safihre for reaching out to me and allowing me to contribute to their product with the notification add-on.
Sources
- An updated blog on setting up NZBGet and/or SABnzbd
- SABnzbd official website: Can’t hurt to visit the source and learn more about the product. Here is a direct link to their wiki which is great too. Here is a link to their GitHub page.
- NZB-Notify: My Notification tool with extended SABnzbd support.
- Another blog I wrote on Usenet a while back which focuses on NZBGet and other tools. The blog is still useful for even a CentOS 7 setup as I’ve ported over most of these packages too.
you have a typo here:
# Download and install SABnzbd plus the Notification Addon
# on CentOS 7.x using the nuxref repositories located
# here: http://nuxref.com/repo/
yum install -y –enablerepo=nuxref \
–enablErepo=nuxref-shared \
sabnzbd sabnzbd-script-notify
Fixed! Thank you!
Just a quick note to help others, ensure your zone is correct when using this command:
firewall-cmd –zone=home –add-service sabnzbd –permanent
You can check the zone with:
firewall-cmd –get-active-zones
There is a new version of SABnzbd available (2.3.6), looks like your repo is out of date. Just a headsup!
Thanks
Thanks, I updated the EPEL version
Any instructions to install SABnzbd on CentOS 7 without being connected to your repository ?
You could directly pull the RPM in with yum
yum install --nogpg \
http://repo.nuxref.com/centos/7/en/x86_64/custom/sabnzbd-2.3.7-1.el7.nuxref.noarch.rpm \
http://repo.nuxref.com/centos/7/en/x86_64/custom/python-sabyenc-3.3.5-1.el7.nuxref.x86_64.rpm
The only problem with that route is as new versions come out you need to do it again (instead of just typing ‘yum update‘).
This will work too ‘IF’ you have all of the dependencies satisfied:
rpm -Uhi \
http://repo.nuxref.com/centos/7/en/x86_64/custom/sabnzbd-2.3.7-1.el7.nuxref.noarch.rpm \
http://repo.nuxref.com/centos/7/en/x86_64/custom/python-sabyenc-3.3.5-1.el7.nuxref.x86_64.rpm
Thanks for all of the work you have done with this!
Are you planning to release a Fedora 29 repo/release?
Done! π
Keep in mind that Fedora 29 is the last version of Fedora that still supports Python 2.x. So SABnzbd won’t work in Fedora 30+ unless you run it in a docker container or VM (running an older OS).
I haven’t created the repo packages yet or updated this page; but for now you should be able to manually install it:
dnf install http://repo.nuxref.com/fedora/fc29/en/x86_64/custom/sabnzbd-2.3.8-1.fc29.nuxref.noarch.rpm
Thank you very much! Appreciate the help.
HI…
http://repo.nuxref.com/centos/7/en/x86_64/custom/sabnzbd-2.3.7-1.el7.nuxref.noarch.rpm
not exist any more?
curl: (22) The requested URL returned error: 404 Not Found
error: skipping http://repo.nuxref.com/centos/7/en/x86_64/custom/sabnzbd-2.3.7-1.el7.nuxref.noarch.rpm – transfer failed
[
Thx.
Hi,
I only keep up to 2-3 versions back. Check out here for the latest: http://repo.nuxref.com/centos/7/en/x86_64/custom/repoview/sabnzbd.html
hmm,… is par2cmdline required?
Error: Package: 2:sabnzbd-2.3.9-1.el7.nuxref.noarch (nuxref)
Requires: par2cmdline
You could try using –skip-broken to work around the problem
You could try running: rpm -Va –nofiles –nodigest
Added it … it works now.
yum install -y –enablerepo=nuxref –enablerepo=nuxref-shared sabnzbd sabnzbd-script-notify
Yes, definitely; there are several dependencies of SABnzbd.
par2cmdline ships with EPEL so i didn’t rehost it here (on nuxref).
To get you going though, you could just do this:
The above is untested; but ‘should’ work for you π
On centos 8, I had some issues picking the right alternate for python to get sabnzb installed…. after using
update-alternatives –config python
to set python3… I’m getting this. Advice?
[root@localhost bin]# yum install -y sabnzbd-script-notify
Last metadata expiration check: 0:03:11 ago on Sat 21 Nov 2020 05:50:22 PM EST.
Error:
Problem: conflicting requests
– nothing provides python-chardet needed by sabnzbd-script-notify-0.9.4-1.el8.nuxref.noarch
– nothing provides python3-gntp needed by sabnzbd-script-notify-0.9.4-1.el8.nuxref.noarch
– nothing provides python-apprise needed by sabnzbd-script-notify-0.9.4-1.el8.nuxref.noarch
– nothing provides python-gntp needed by sabnzbd-script-notify-0.9.4-1.el8.nuxref.noarch
– nothing provides python-markdown needed by sabnzbd-script-notify-0.9.4-1.el8.nuxref.noarch
– nothing provides python-ordereddict needed by sabnzbd-script-notify-0.9.4-1.el8.nuxref.noarch
– nothing provides python-nzbget >= 0.6.1 needed by sabnzbd-script-notify-0.9.4-1.el8.nuxref.noarch
– nothing provides python-six needed by sabnzbd-script-notify-0.9.4-1.el8.nuxref.noarch
Hi,
For CentOS 8, I’ve already packaged the latest version of SABnzb (Python v3); check out this link here
See SABnzbd forums too if you want here for my post on the setup.
Hi thanks for making SABnzbd available via a repo so that we can get all the dependencies sorted..
i’m on fedora 33 (planning to move to 34 in a couple of months).
i’m moving from OSX to fedora and on my must have list is SABnzbd, so very happy to find your repo thanks again..
couple of things i just found working on the install.
rpmfusion-nonfree-updates contains a newer version of unrar.
6.0.3 vs 5.9.4 . so i looked at the priority setting in the .repo file.
i read somewhere that priority 99 is the default. And if two repo’s have the same priority the latest version is picked.
so i commented the priority 2 setting and set it to 99 and now i get the newest version of unrar.
also for the firewall here’s what i did:
see what the default zone is:
firewall-cmd –get-default-zone
Now add sabnzbd to the default zone:
firewall-cmd –zone=FedoraWorkstation –add-service=sabnzbd –permanent
now reload:
firewall-cmd –reload
Now check:
firewall-cmd –list-all
i’m having trouble connecting an external drive and having that as a completed download folder.. /run/media/username/folder
doesn’t seem to want to show up.. don’t know if i need to re login perhaps it has something to do with the user i’m using and group privileges ?
question: when do you think you will update to the latest version 3.2.1 ?? i see the repo has only version 3.1.1 released 151 days ago.
Thanks again for everything..
Hi,
I’m running CentOS 7 and i’m unable to start the sabnzbd.service.
sabnzbd.service – SABnzbd Daemon
Loaded: loaded (/etc/systemd/system/sabnzbd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2021-10-22 19:41:20 EDT; 15s ago
Process: 37075 ExecStart=/usr/bin/python /opt/sabnzbd/SABnzbd.py –daemon –config-file=/opt/sabnzbd/sabnzbd_config.ini -s 0.0.0.0 (code=exited, status=1/FAILURE)
Oct 22 19:41:20 localhost.localdomain systemd[1]: Starting SABnzbd Daemon…
Oct 22 19:41:20 localhost.localdomain python[37075]: detected unhandled Python exception in ‘/opt/sabnzbd/SABnzbd.py’
Oct 22 19:41:20 localhost.localdomain python[37075]: File “/opt/sabnzbd/SABnzbd.py”, line 152
Oct 22 19:41:20 localhost.localdomain python[37075]: self._size: int = size
Oct 22 19:41:20 localhost.localdomain python[37075]: ^
Oct 22 19:41:20 localhost.localdomain python[37075]: SyntaxError: invalid syntax
Oct 22 19:41:20 localhost.localdomain systemd[1]: sabnzbd.service: control process exited, code=exited status=1
Oct 22 19:41:20 localhost.localdomain systemd[1]: Failed to start SABnzbd Daemon.
Oct 22 19:41:20 localhost.localdomain systemd[1]: Unit sabnzbd.service entered failed state.
Oct 22 19:41:20 localhost.localdomain systemd[1]: sabnzbd.service failed.
Can you please advice? Thank you.