[PP-Script / Queue-Script] Notifications (All In One)

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
Post Reply
l2g
Posts: 185
Joined: 27 Jun 2014, 22:13
Contact:

[PP-Script / Queue-Script] Notifications (All In One)

Post by l2g » 25 Nov 2014, 02:13

I'm not out to compete with the other great notification scripts that others have made. Their's are much less complex then this one. I just thought it would be easier to migrate all notification services into one plugin.

It also utilizes the pynzbget I wrote which simplifies NZBGet script development.

Notify NZBGet Script Details
Author: Chris Caron <lead2gold@gmail.com>
Current Version: 0.6.1
Release Date: Jul 9th, 2017
License: GPLv2
Source: GitHub / Direct Download Link

Updates:
  • Jul 9th, 2017 Update (v0.6.1):
    • Small bug fix for MatterMost Notifications users.
    • Inline Configuration Check (users can test their settings now right from the NZB-Get configuration page)!
  • Jul 5th, 2017 Update (v0.6.0):
  • Jan 23rd, 2017 Update (v0.5.6):
    Minor release just applying a few outstanding bug fixes.
  • Sep 20th, 2016 Update (v0.5.5):
    Minor release adding:
  • Aug 5th, 2016 Update (v0.5.0):
    New release which adds 2 new notification services
  • July 19th, 2016 Update (v0.4.0): Minor release that just added support for SABnzbd.
So far this notification script supports: How does it work
It's pretty simple, you just use space and/or comma to delimit your servers you want to notify. Specify as many as you want and have as many notifications sent as you need.
The syntax works as follows:
  • service://user@host:port
  • service://password@host:port
  • service://user:password@host:port
  • service://host:port
  • service://host
NZBGet Notifications relies heavily on relaying the information it extracts from an NZBGet RPC call it makes. It's important that your RPC Server is running (NZBGet out of the box has it already configured). If your not sure, just make sure you're listening on a local address in your Settings -> Security options of your configuration. Setting a TCP/IP address of 0.0.0.0 is the easiest way to ensure you won't have a problem.

Here are a few things it can do:
  • Supports listing the downloaded files, displaying statistics, and/or displaying the log entries.
  • Can act as a Queue-Script and notify you when something was just added to the queue.
  • You can specify as many Push Notification servers as you want.
  • Notification services that support HTML content can be notified as such.
  • Notification services that support graphic images can display a fancy red (failure), green (success), or blue (info) image to enhance the user experience. :)
Boxcar Users
For Boxcar users, you just need to decide if you're accessing an insecure (boxcar://) or secure (boxcars://) server. Then you can optionally specify aliases, device tokens and/or tags on the path using the slash as a delimiter. You can mix and match them too, the script will look after notifying them for you.
  • boxcars://hostname
  • boxcars://user@pass:hostname/
  • boxcars://hostname/device_token/device_token2/device_tokenN
  • boxcars://hostname/@tag1/@tag2/@tagN
  • boxcars://hostname/alias1/alias2/aliasN
  • boxcars://hostname/@tag/device_token/alias/etc
Faast
For Faast users, you need an authtoken... and that's it:
faast://authtoken

Notify My Android Users
For Notify My Android users, you need an apikey... and that's it:
nma://apikey

Emails
Emails are new as of version 0.2.0 and are a little more complicated since they require a lot of extra details. The script has built in support for mainstream services (such as GMail, Hotmail, and Yahoo). This can be easily expanded too! The below show examples of these services. The script is smart enough to take the userid and domain and know the security settings, port, and to combine userid@domain.com for the login.

Emails are all delivered in an HTML format for presentation purposes. They can be reverted to text by specifying format=text as a parameter passed on URL.

mailto://userid:password@gmail.com
Note: For GMail, you may need to generate an App Password if you're set up using the 2 Step Verification Process.

mailto://userid:password@yahoo.com
mailto://userid:password@hotmail.com
mailto://userid:password@live.com
mailto://userid:password@prontomail.com

For more custom emails, the script gets more complicated. It's up to you if maybe just using HugBug's standalone Email plugin (which is shipped with NZBGet) as an easier solution. First off, secure vs insecure emails are defined by mailto:// (port 25) and mailtos:// (port 587) where mailtos:// will enable TLS prior to sending the user and password.

mailtos://userid:password@server.com?smtp=smtp.server.com

If you need to over-ride the SMTP Port, you can do so like this:
mailtos://userid:password@server.com:465?smtp=smtp.server.com

Also, it's It's important to note that if your username is an email address, you need to specify it as a user= parameter after:
mailtos://server.com?user=user@server.com&pass=password

There are lots of options supported too:
mailtos://userid:password@server.com?timeout=40&smtp=mail.server.com&from=afrom@email.address.com&name=Optional%20Name

PushBullet Users
For PushBullet users, you need an apitoken to access your devices. The following will access them all:
pbul://apitoken

If you want to target specific PushBullet device(s), channel(s), and/or email(s), just specify them on the path using the slash as a delimiter. You can mix and match them too, the script will look after notifying them for you. Growl Users
For Growl users, you can optionally specify a password or just identify the growl server. The following illustrates this:
growl://server
growl://password@server

Older Growl servers running v1.x may need to specify the version to 1 to get it working; ie:
growl://password@server?version=1

In order for Growl to run; each client that sends messages to it needs to register itself with the Growl server. Make sure that you've configured your server to allow registration. In addition to this; make sure that after this Notify tool registers itself with it; that you grant it access to pass the notifications along.

Prowl Users
For Prowl users, you need an apikey to access your devices. The following will access them all:
prowl://apikey

If you need to specify your provider key, you can add it to the URL as follows:
prowl://apikey/providerkey

Pushalot Users
The following can query a pushalot server:
palot://authorizationtoken

Pushover Users
You'll need to provide both your token and userid which can be done using this format. To access all devices just do the following:
pover://user@token

If you want to target a specific (or more then one) device only, you can do the following:
pover://user@token/DEVICEID/DEVICEID2/DEVICEIDN

Telegram Notification Users
Telegram is for the most part straight forward to set up. You need to create an account and generate a bot (through the /@BotFather). He'll give you an APIkey you can use the interface with your bot. The API key will look something like this: 123456789:1AbCdEfG2hIjKlMnO3-pQrStU4_vWxYz.

With this info, you can now start messaging the bot with the URL:
tgram://APIkey/userid

This will work too:
tgram://user@APIkey

You can send to more then one userid or channel by either its ID (numeric) or it's name (alphanumeric). The script will figure out what you meant and send the message as intended.
tgram://APIkey/channel

Feel free to mix and match as many as you want:
tgram://APIkey/channel1/userid1/channelN/useridN/etc

Slack Notification Users
To use this plugin, you need to first access https://api.slack.com; specifically https://my.slack.com/services/new/incoming-webhook/ to create a new incoming webhook for your account. You'll need to follow the wizard to pre-determine the channel(s) you want your message to broadcast to, and when you're complete, you will receive a URL that looks something like this:

Consider this Key:
https://hooks.slack.com/services/T1JJ3T3L2/A1BRTD4JD/TIiajkdnlazkcOXrIdevi7F
You can break these down as follows:
  • TokenA: T1JJ3T3L2
  • TokenB: A1BRTD4JD
  • TokenC: TIiajkdnlazkcOXrIdevi7F
From here you can assemble your urls as so:
slack://TokenA/TokenB/TokenC/#Channel
slack://TokenA/TokenB/TokenC/#Channel1/#Channel2/#ChannelN
slack://botname@TokenA/TokenB/TokenC/#Channel

MatterMost Notification Users
To use this plugin, you need to first set yourself up with http://mattermost.com. Download their software and set it up. The setup is based on Incoming Web Hooks requiring you to generate your own WebHook ID. The default port is 8065 unless otherwise specified. Knowing this, you can assemble your urls as so:
mmost://hostname/WebHook
mmost://user@hostname/WebHook
mmost://hostname:80/WebHook
mmosts://secure.hostname/WebHook
mmosts://secure.hostname:443/WebHook

Join Notification Users
To use this plugin, you need to first access (make sure your browser allows popups): https://joinjoaomgcd.appspot.com/
To register you just need to allow it to connect to your Google Profile but the good news is it doesn't ask for anything too personal.
You can download the app for your (Android) phone here: https://play.google.com/store/apps/deta ... omgcd.join
From here, you're good to go :
join://apikey/DeviceID
join://apikey/DeviceID1/DeviceID2/DeviceIDN
join://apikey/group.all
join://apikey/all
join://apikey/group.all/group.chrome/group.tablet
join://apikey/DeviceID1/group.all/group.chrome/DeviceID2/

(Super) Toasty Users
You MUST specify at a user and at a least 1 device for this to work:
toasty://user@device

You can specify more then one device too:
toasty://user@device1/device2/deviceN

Command Line
Most of my testing is done using the Command Line Interface I attached to it. For example a simple entry like this could send 'Hello World' to your XBMC server:

Code: Select all

python Notify.py -s xbmc://192.168.0.2 -t "Hello" -b "World!"
Here is what the tool offers so far (from the command line):

Code: Select all

Usage: Notify.py [options]

Options:
  -h, --help            show this help message and exit
  -s URL(s), --servers=URL(s)
                        Specify 1 or more servers in their URL format ie:
                        growl://mypass@localhost
  -t TITLE, --title=TITLE
                        Specify the title of the notification message.
  -b BODY, --body=BODY  Specify the body of the notification message.
  -i, --include_image   Include image in message if the protocol supports it.
  -L FILE, --logfile=FILE
                        Send output to the specified logfile instead of
                        stdout.
  -D, --debug           Debug Mode
Thank you binreader for all of your protocol suggestions; I'll be able to tackle most of them except a few due to the fact they can't be accessed without compiling code. I'm going to stick with python for now to be cross-platform friendly.

Happy Notifying :)
Last edited by l2g on 25 Aug 2017, 19:17, edited 51 times in total.

binreader
Posts: 17
Joined: 07 Oct 2014, 03:00

Re: [PP-Script] Notifications; Growl,XBMC, Prowl, PushBullet

Post by binreader » 26 Nov 2014, 14:11

It's a cool idea, one ring to unite them all. Perhaps when this one is ship shape hugbug may put into the distro.

Pushover is another service, I saw a script in the forums for it but itsa a paid app after trial period.
Last edited by binreader on 02 Dec 2014, 15:55, edited 1 time in total.

l2g
Posts: 185
Joined: 27 Jun 2014, 22:13
Contact:

Re: [PP-Script] Notifications; Growl,XBMC, Prowl, PushBullet

Post by l2g » 26 Nov 2014, 15:53

Thanks binreader,

I've added Pushover (pover://) to the TODO list,
Last night I created a simple JSON one too which can be used to just send content to a someone's website they set up which could be stored easily in a database accessible via json:// and jsons:// (secure version). Perhaps I should do a generic XML (SOAP) (xml:// and xmls://) one too?

I intend to add the Download Statistics and File Listings into the success/failure message too. In this early stage of development, i'm just trying to acknowledge as many protocols as I can. Thanks again for your feedback!

binreader
Posts: 17
Joined: 07 Oct 2014, 03:00

Re: [PP-Script] Notifications; Growl,XBMC, Prowl, PushBullet

Post by binreader » 26 Nov 2014, 21:14

Here is a list from a well respected nzb site

iOS
boxcar
Boxcar 2
prowl
faast/push 4.0
Pushbullet
Pushover

Android
notify my android
Pushbullet
Pushover

Windows Phone
Pushalot
Supertoasty

l2g
Posts: 185
Joined: 27 Jun 2014, 22:13
Contact:

Re: [PP-Script] Notifications; Growl,XBMC, Prowl, PushBullet

Post by l2g » 01 Dec 2014, 21:55

Thanks binreader for all the protocols you suggested!

I was able to impliment most of those and put together a release. I do not have an account for half of these services. each plugin was just created by following the documented API instructions on their websites.

If anyone has any issues, i'd be happy to address them!
Last edited by l2g on 02 Dec 2014, 20:55, edited 1 time in total.

hugbug
Developer & Admin
Posts: 6587
Joined: 09 Sep 2008, 11:58
Location: Germany (NRW)

Re: [PP-Script] Notifications; Growl,XBMC, Prowl, PushBullet

Post by hugbug » 01 Dec 2014, 22:55

That's incredible.

And to make the list complete may be mailto"?

l2g
Posts: 185
Joined: 27 Jun 2014, 22:13
Contact:

Re: [PP-Script] Notifications; Growl,XBMC, Prowl, PushBullet

Post by l2g » 02 Dec 2014, 02:22

hugbug wrote:And to make the list complete may be mailto"?
I thought about that, the only problem with the mailto:// will be all the other settings such as the smtp mail server. I could try some basic guessing by the domain the user has. Hence if the users email is test@gmail.com i could try smtp.gmail.com and then mail.gmail.com etc. But then i'd have to also guess at SMTP ports (starting with the secure ones first).

It would certainly become messy and confusing fast though when you populate the field:

hence, it might look something (overly complicated) ilke this:

Code: Select all

mailto://user:smtppass@domain.com:smtpport/?smtp=srv.domain.com
I kind of like having the mail notification seperate just due to all of the configuration it entails. Plus your Email.py you got in place is solid! :)

I do intend to add the statistics, file listings, html support (to the notification servers that support it), and perhaps a Queue Script portion that notifies you when something has just begun downloading.

Anyway... your thoughts?

binreader
Posts: 17
Joined: 07 Oct 2014, 03:00

Re: [PP-Script] Notifications; Growl,XBMC, Prowl, PushBullet

Post by binreader » 02 Dec 2014, 16:05

Wow l2g you have come a far distance in a very short time. Now that we have a release I will do some testing I have pushbullet, prowl and xbmc and am familiar with the original notification scripts for all 3.

IMHO the measuring stick around here when it comes to notifications is the pushbullet script. It has a ton of options to config like skipping notifications on certain category and the formatting of the title and body. But I'll compare against this new integrated one.

Also I notice you have xbmc you may want to also include plex which has an api. plex is like xbmc but more popular because it is split into client and server components. So you notify the clients. However plex is a bit of ball of wax cuz under certain circumstance you may need to call the server refresh method else the client notification is a bit pointless. some setups of plex do not require server refresh as it is handled automagically. So a lot config options need to be there, check mannibis script on the forums for re details.

l2g
Posts: 185
Joined: 27 Jun 2014, 22:13
Contact:

Re: [PP-Script] Notifications; Growl,XBMC, Prowl, PushBullet

Post by l2g » 03 Dec 2014, 13:23

binreader,

I didn't realize pushbullet was free, i signed up yesterday just to play around with it and it didn't work until i made one small adjustement. It works now without any problems. So you'll want to grab the latest version (updated the main post).

Hopefully tonight i'll get the statistics and file listings added to the response too.

Dec 3rd, 2014 Edit: Statistics, html support and file listings added. I haven't set up any services to utilize the html yet, but that's next. Once again, i bumped the version. So you'll want to grab it to get these bells and whistles.

Dec 4th, 2014 Edit: Logging now optional choice too, Queue-Script support now too pushing notifications when new nzb files are added. Some bullet proofing added and all previous features are optional choices.

Dec 29th, 2014 Edit: Bugfix with log sorting

Also, I've got mixed thoughts about adding Plex support just because of all the things you have to do in some cases. My goal is to just support notification services. I think i'll leave all that crazy Plex overhead to the other guy who's maintaining an exclusive script for it. :) That said, if Plex just has a 'popup' notification style thing, i'll gladly impliment that.

carp969
Posts: 4
Joined: 14 Oct 2014, 08:24

Re: [PP-Script / Queue-Script] Notifications (All In One)

Post by carp969 » 13 Jan 2015, 22:03

Thanks for this. I use Push Over a lot but never got round to getting a queue script working.

I'm finding that it doesn't translate the spaces from %20. So the title for a new nzb item shows as New%20File%20Queued%20for%20Download in pushover.

Post Reply

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests