Skip to content

Commit c4b3027

Browse files
authored
Updated Readme to better reflect SABnzbd Integration
2 parents 32521d5 + fdf3cc4 commit c4b3027

File tree

2 files changed

+52
-68
lines changed

2 files changed

+52
-68
lines changed

README.md

Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,67 @@
1-
__Note:__ This script was originally written to be an [NZBGet](https://nzbget.net) _post-processing_ script notifying you of retrieved content through a variety of different notification services. But will work for SABnzbd users (starting at v1.1.0+) as well. The script additionally works fine as standalone tool for anyone else too! See the _Command Line_ section below for details how you can easily use this on it's own (without NZBGet).
2-
3-
SABnzbd users can reference sabnzbd-notify.py to gain support of the tool as well.
1+
## Notify Processing Script
42

53
[![Paypal](https://repo.nuxref.com/pub/img/paypaldonate.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MHANV39UZNQ5E)
64

5+
Send notifications to all of the popular notification services (PushBullet, NotifyMyAndroid, XBMC, Email etc) from NZBGet or SABnzbd.
6+
You can chain as many notification services as you want and support most of the advance features each service offers you too.
7+
You can even run the tool from the command line for your own custom use.
8+
79
## Built on Apprise
810

911
This guts of this script have been recently extracted into it's own project called [Apprise](https://github.com/caronc/apprise) which allows others to build Notifications into their applications as well.
12+
Apprise was written in such a way that there wouldn't be a lot of effort to add more notification services either. Feel free to contact me if one you would like to use is missing.
1013

11-
## Notify Processing Script
12-
13-
Send notifications to all of the popular notification services (PushBullet, NotifyMyAndroid, XBMC, Email etc). NZBGet (and/or SABnzbd) will automatically notify you of anything it downloads. You can chain as many notification services as you want and support most of the advance features each service offers you too.
14+
## Supported Notifications
1415

15-
You can even run the tool from the command line for your own custom use. Notify.py was written in such a way that there wouldn't be a lot of effort to add more notification services either. Feel free to contact me if one you would like to use is missing.
16+
For a complete list of supported notification services and examples on how to build their URLs [click here](https://github.com/caronc/apprise/wiki#notification-services).
1617

17-
## Installation Instructions
18+
## Installation and usage instructions
1819

1920
1. Ensure you have Python v2.7 or later installed onto your system.
2021
```bash
2122
# Pull in dependencies:
2223
pip install -r requirements.txt
2324
```
24-
2. Simply place the __Notify.py__ and __Notify__ directory together.
25+
2. Simply place the `Notify.py` and `Notify` directory together.
2526
* __NZBGet users__: you'll want to place these inside of your _nzbget/scripts_ directory. Please ensure you are running _(at least)_ NZBGet v11.0 or higher. You can acquire the latest version of of it from [here](https://nzbget.net/download).
2627
* __NZBGet users__: As one additional note; this script makes use of the RPC feature of NZBGet in order to retrive all of the status information it will notify you with. Its very important that this is configured correctly (in the 'Settings -> Security' area). The out of the box settings should work fine; but worth noting here should experience any issues.
27-
* __SABnzbd users__: You'll point your SABnzbd configuration to reference sabnzbd-notify.py via the _Script_ entry and _not_ Notify.py. However, please note that the Notify.py script is still required (as sabnzbd-notify.py is a wrapper to it). You will use the _Parameters_ section to provide the services you wish to notify (see below how they are constructed).
28+
* __SABnzbd users__: You'll point your SABnzbd configuration to reference `sabnzbd-notify.py` via the _Script_ entry and _not_ `Notify.py`. However, please note that the `Notify.py` script is still required (as `sabnzbd-notify.py` is a wrapper to it). You will use the _Parameters_ section to provide the services you wish to notify (see below how they are constructed).
2829

29-
The Non-NZBGet/SABnzbd users can also use this script from the command line.
30-
See the __Command Line__ section below for more instructions on how to do this.
30+
See the __Command Line__ section below for more instructions on how to call the script from the command line.
3131

32-
## Supported Notifications
32+
## SABnzbd Users
33+
SABnzbd users can test that their script is working okay manually as well if they're having issues with it through their application. This is also a great way to test out that you've created the correct URL string.
34+
```bash
35+
# Send a notification to XBMC (assuming its listening on
36+
# port 8080 at the ip 192.168.0.2 with respect to the example
37+
# below:
38+
python sabnzbd-notify.py complete 'Hello' 'World' xbmc://192.168.0.2
39+
```
40+
The syntax is very similar except SABnzbd expects 4 distinct arguments.
41+
42+
| Arg # | Description |
43+
| ----- |:----------- |
44+
| 1 | The type of notification we are sending. This has an impact on the icon (for those that support it) that you will pass along with the message.
45+
| 2 | The title of the notification message. If this is an empty string, then there is enough information based on the notification type you passed in (argument 1) to generate a title. |
46+
| 3 | The message body. |
47+
| 4 | Comma delimited URL strings just like the ones already discussed above.
3348

34-
**For a complete list of supported notification services and examples on how to build their URLs [click here](https://github.com/caronc/apprise/wiki#notification-services)**.
49+
### SABnzbd Configuration
50+
First, make sure you've placed `sabnzb-notify.py`, `Notify.py`, and the `Notify` directory inside of the `/path/to/SABnzbd/scripts/` directory or the instructions below will not work.
51+
52+
Once you know the _URL_(s) that work for you, you can set SABnzbd to automatically notify setting it up as follows. From within SABnzbd's web interface:
53+
54+
- Click on __Settings__
55+
- Click on __Notifications__
56+
- Place a checkbox in the __Enable notification script__ option.
57+
- Choose `sabnzb-notify.py` from the Script dropdown menu.
58+
- Specify the URL such as `kodi://192.168.0.2` in the _Parameters_ section. You can specify more then one URL here by simply using a _comma_ (`,`) as a delimiter.
59+
60+
CentOS/RedHat users can also refer to a [blog entry I prepared](https://nuxref.com/2016/10/20/sabnzbd-installation-centos-7/) for this which includes RPM packaging for both [SABnzbd](https://repo.nuxref.com/centos/7/en/x86_64/custom/repoview/sabnzbd.html) and [NZB-Notify](https://repo.nuxref.com/centos/7/en/x86_64/custom/repoview/sabnzbd-script-notify.html). These can be easily installed (with all required dependencies by just getting yourself set up with my repository [here](https://nuxref.com/nuxref-repository/).
3561

3662
## Command Line
3763

38-
**Notify.py** has a built in command line interface that can be easily tied
64+
`Notify.py` has a built in command line interface that can be easily tied
3965
to a cron entry or can be easily called from the command line to automate
4066
the fetching of subtitles.
4167

@@ -83,35 +109,5 @@ python Notify.py \
83109
-t "Hello" -b "World!"
84110
```
85111

86-
## SABnzbd Users
87-
SABnzbd users can test that their script is working okay manually as well if they're having issues with it through their application. This is also a great way to test out that you've created the correct URL string.
88-
```bash
89-
# Send a notification to XBMC (assuming its listening on
90-
# port 8080 at the ip 192.168.0.2 with respect to the example
91-
# below:
92-
python sabnzbd-notify.py complete 'Hello' 'World' xbmc://192.168.0.2
93-
```
94-
The syntax is very similar except SABnzbd expects 4 distinct arguments.
95-
96-
| Arg # | Description |
97-
| ----- |:----------- |
98-
| 1 | The type of notification we are sending. This has an impact on the icon (for those that support it) that you will pass along with the message.
99-
| 2 | The title of the notification message. If this is an empty string, then there is enough information based on the notification type you passed in (argument 1) to generate a title. |
100-
| 3 | The message body. |
101-
| 4 | Comma delimited URL strings just like the ones already discussed above.
102-
103-
### SABnzbd Configuration
104-
First, make sure you've placed __sabnzb-notify.py__, __Notify.py__, and the __Notify__ inside of the _/path/to/SABnzbd/scripts/_ directory or the instructions below will not work.
105-
106-
Once you know the _URL_(s) that work for you, you can set SABnzbd to automatically notify setting it up as follows. From within SABnzbd's web interface:
107-
108-
- Click on __Settings__
109-
- Click on __Notifications__
110-
- Place a checkbox in the __Enable notification script__ option.
111-
- Choose __sabnzb-notify.py__ from the Script dropdown menu.
112-
- Specify the URL such as kodi://192.168.0.2 in the _Parameters_ section. You can specify more then one URL here by simply using a _comma_ (,) as a delimiter.
113-
114-
CentOS/RedHat users can also refer to a [blog entry I prepared](https://nuxref.com/2016/10/20/sabnzbd-installation-centos-7/) for this which includes RPM packaging for both [SABnzbd](https://repo.nuxref.com/centos/7/en/x86_64/custom/repoview/sabnzbd.html) and [NZB-Notify](https://repo.nuxref.com/centos/7/en/x86_64/custom/repoview/sabnzbd-script-notify.html). These can be easily installed (with all required dependencies by just getting yourself set up with my repository [here](https://nuxref.com/nuxref-repository/).
115-
116112
## Donations
117113
If you like this script and feel like donating, you can do so through either [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MHANV39UZNQ5E) or [sponsor me](https://github.com/sponsors/caronc)! Thank you so much to everyone who has donated in the past!

sabnzbd-notify.py

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -154,29 +154,17 @@ def notify(ntype, title, body, urls, debug=None):
154154
if debug is None:
155155
debug = DEBUG_MODE
156156

157-
if sys.platform[0:3] == 'win':
158-
# Windows systems require the executable 'python'
159-
# up front
160-
cmd = [
161-
'python',
162-
NOTIFY_SCRIPT,
163-
'-t', title,
164-
'-b', body,
165-
'-T', 'sabnzbd',
166-
'-n', SABNZBD_NOTIFICATION_MAP[ntype][1],
167-
'-s', urls,
168-
]
169-
else:
170-
# Other systems determine the environment from
171-
# the executable's first line #!
172-
cmd = [
173-
NOTIFY_SCRIPT,
174-
'-t', title,
175-
'-b', body,
176-
'-T', 'sabnzbd',
177-
'-n', SABNZBD_NOTIFICATION_MAP[ntype][1],
178-
'-s', urls,
179-
]
157+
# We use the Python interpreter that was also used by
158+
# SABnzbd when it executed this script
159+
cmd = [
160+
sys.executable if sys.executable else "python",
161+
NOTIFY_SCRIPT,
162+
'-t', title,
163+
'-b', body,
164+
'-T', 'sabnzbd',
165+
'-n', SABNZBD_NOTIFICATION_MAP[ntype][1],
166+
'-s', urls,
167+
]
180168

181169
if debug:
182170
# Debug Mode Enabled

0 commit comments

Comments
 (0)