iPhone/iOS push notifications upon download completion

Come up with a useful post-processing script? Share it here!
Post Reply
trollied
Newbie
Newbie
Posts: 4
Joined: September 24th, 2010, 11:24 am

iPhone/iOS push notifications upon download completion

Post by trollied »

NOTE: Have a tester helping me to resolve an issue or two (thanks!) - have removed the script temporarily - Will fix it tomorrow (Saturday!)

Hi all,

This is my first post on the forum and I hope you find it useful.

Using this small perl post-processing script and the free http://www.notifo.com service, it's possible to get sabnzbd to send push notifications to your iOS device once a download has completed.

Example screenshots:

Image

Image

First, you have to register for an account at Notifo (disclaimer: I've got nothing to do with them - I found it recently and use it to send me various notifications from some of my Unix servers) - http://www.notifo.com .

Once you're registered, go to your settings page http://notifo.com/user/settings - this contains your username and apikey - you'll need these in a moment.

Note you'll also need to install the Notifo iOS application. You can find this in the iTunes app store and in the App Store application on your iOS device.

Download the script from http://prowl.trollied.net/notifo.pl, and save it to your sabnzbd Post-Processing Scripts Folder (you can find the location by looking in Config->Folders. If a folder isn't already defined, create one on your filesystem and add the path in the empty box).

Next open the script in your editor of choice (notepad, ultraedit, vim, emacs, textmate, whatever...) and change the 2 lines that look like this:

Code: Select all

my $notifousername = 'yourusernamehere';
my $notifoapikey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
and add your own username and apikey, replacing 'yourusernamehere' and 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' with the values on your settings page http://notifo.com/user/settings.

Linux/MacOS

The script should work out of the box (I've tested on Snow Leopard and Ubuntu 10.10). Just make sure it's executable. Do a chmod +x notifo.pl if unsure.

If not, you need to install the perl bundle Bundle::LWP.

In Ubuntu/Debian:

Code: Select all

sudo perl -MCPAN -e 'install Bundle::LWP'
Other flavours of Linux you'll need to "su -" to root and run:

[url=http://perl%20-MCPAN%20-e%20'install%20Bundle::LWP']perl -MCPAN -e 'install Bundle::LWP'[/url]


Windows

Install Activeperl - http://www.activestate.com/activeperl/downloads - pick 64-bit or 32-bit depending on your windows version.

I've tested on Windows 7 64-bit, and it works perfectly.



In sabnzbd, choose the script to Config->Switches->Default User Script.

Once all of the above is complete, launch the Notifo app on your iOS device, login with your username and password & everything should be perfect!

Any questions, let me know & I'll get back to you as soon as possible.

Cheers,

Phil

Edit: I'll knock up a Python version tomorrow so that the Windows folks don't need ActivePerl
Last edited by trollied on September 24th, 2010, 3:59 pm, edited 1 time in total.
synapseattack
Newbie
Newbie
Posts: 6
Joined: March 4th, 2010, 8:09 pm

Re: iPhone/iOS push notifications upon download completion

Post by synapseattack »

this is EXACTLY like something I've been thinking about. Nice script I just added it to my scripts.

Thanks!
trollied
Newbie
Newbie
Posts: 4
Joined: September 24th, 2010, 11:24 am

Re: iPhone/iOS push notifications upon download completion

Post by trollied »

synapseattack wrote: this is EXACTLY like something I've been thinking about. Nice script I just added it to my scripts.

Thanks!
No worries. Let me know how it works for you. I'm going to look and see if I can integrate it into sabnzbd directly, and allow custom notifications (along the lines of how you can name series etc), and add filesize etc. Hopefully the devs would happily accept a diff :)

Having the username and apikey in the configuration menu would be so much easier for people.

Cheers,

Phil
Last edited by trollied on September 24th, 2010, 1:11 pm, edited 1 time in total.
synapseattack
Newbie
Newbie
Posts: 6
Joined: March 4th, 2010, 8:09 pm

Re: iPhone/iOS push notifications upon download completion

Post by synapseattack »

I must be doing something wrong. I get the following error:

Code: Select all

Can't locate HTTP/Request/Common.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /home/xbmc/sabnzbd/scripts/notifo.pl line 4.
BEGIN failed--compilation aborted at /home/xbmc/sabnzbd/scripts/notifo.pl line 4.

I'm guessing I don't have the right perl libraries installed... Let me know what you think I'm screwing up and I'll get it fixed.

(Edit: Submitted before finishing my thought)

I fixed the above error by installing the correct perl libraries from cpan.

Code: Select all

sudo perl -MCPAN -e 'install Bundle::LWP'
New error after this of:

Code: Select all

Argument "alt.binaries.inner-sanctum" isn't numeric in numeric eq (==) at /home/xbmc/sabnzbd/scripts/notifo.pl line 18.
Last edited by synapseattack on September 24th, 2010, 1:29 pm, edited 1 time in total.
trollied
Newbie
Newbie
Posts: 4
Joined: September 24th, 2010, 11:24 am

Re: iPhone/iOS push notifications upon download completion

Post by trollied »

What OS? (if linux, exact distro version).

I'm out having a beer at the moment, but will help (and update instructions) when I get home.

Phil
trollied
Newbie
Newbie
Posts: 4
Joined: September 24th, 2010, 11:24 am

Re: iPhone/iOS push notifications upon download completion

Post by trollied »

I know what's wrong.

Will post in the morning with an updated script.

Phil
synapseattack
Newbie
Newbie
Posts: 6
Joined: March 4th, 2010, 8:09 pm

Re: iPhone/iOS push notifications upon download completion

Post by synapseattack »

trollied wrote: What OS? (if linux, exact distro version).
I am running it on XBMC-Live which is based on 10.04 of Ubuntu.

When I looked at the log I noticed that there were 6 commas separating all the details that sabnzbd was sending

Code: Select all

2010-09-24 14:36:49,460::INFO::[newsunpack:127] Running external script /home/xbmc/sabnzbd/scripts/notifo.pl(/home/xbmc/Media/TV2/downloads/complete/Movies/Yo Gotti Feat  Gucci Mane For The Hood (Prom
o CDS) 2010 S0N0R.2, Yo Gotti Feat  Gucci Mane For The Hood (Promo CDS) 2010 S0N0R.nzb, Yo Gotti Feat  Gucci Mane For The Hood (Promo CDS) 2010 S0N0R, , movies, alt.binaries.inner-sanctum, 0)
If I change the  ARGV line from:

Code: Select all

my ($directory, $nzbname,  $cleannzbname,$category,$newsgroup,$status) = @ARGV;
to:

Code: Select all

my ($directory, $nzbname,  $cleannzbname,$category,$temp,$newsgroup,$status) = @ARGV;
then sabnzbd tells me that it ran the script but I never got the message.

When I ran the command exactly as sabnzbd does then I get the following

Code: Select all

xbmc@mediacenter:~$ /home/xbmc/sabnzbd/scripts/notifo.pl(/home/xbmc/Media/TV2/downloads/complete/Movies/Yo Gotti Feat  Gucci Mane For The Hood (Promo CDS) 2010 S0N0R.2, Yo Gotti Feat  Gucci Mane For The Hood (Promo CDS) 2010 S0N0R.nzb, Yo Gotti Feat  Gucci Mane For The Hood (Promo CDS) 2010 S0N0R, , movies, alt.binaries.inner-sanctum, 0)
bash: syntax error near unexpected token `/home/xbmc/Media/TV2/downloads/complete/Movies/Yo'
Since the first space is right after that 'Yo' I decided to put a \ before the space and it helped and got me as far as 'Yo Gotti' before saying there was a syntax error.
In order for it to get through the whole thing I had to put a \ infront of every space and in front of every . - ( and ). The problem is at the end of the line where we are supposed to have a closing parenthesis it still reports a syntax error and now I am at the limit of my ability. I hope this helps with the information and please let me know anything else you would like tried out.
synapseattack
Newbie
Newbie
Posts: 6
Joined: March 4th, 2010, 8:09 pm

Re: iPhone/iOS push notifications upon download completion

Post by synapseattack »

trollied wrote: I know what's wrong.

Will post in the morning with an updated script.

Phil

Well ok, ignore my last comment  ;D
synapseattack
Newbie
Newbie
Posts: 6
Joined: March 4th, 2010, 8:09 pm

Re: iPhone/iOS push notifications upon download completion

Post by synapseattack »

With the help of trollied I was able to get my install of this working.

I do not know if this is because my system is a XBMC-Live install or not but here is what I had to do.

Code: Select all

sudo apt-get install libnet-ssleay-perl libssl-dev

Code: Select all

sudo perl -MCPAN -e 'install IO::Socket::SSL'
Anyway after this I was able to use the script as supplied.

~SA
Gotcha007
Newbie
Newbie
Posts: 11
Joined: January 25th, 2011, 4:06 pm
Contact:

Re: iPhone/iOS push notifications upon download completion

Post by Gotcha007 »

Hello, see that the script is no longer available. Any idea when it will comes up again?
[url=http://"http://sharethe.tv/gotcha007"]Image[/url][url=http://"http://forum.xbmc.org/showthread.php?p=707931&posted=1#post707931"]Image[/url]
User avatar
computer
Newbie
Newbie
Posts: 41
Joined: January 12th, 2009, 10:38 am

Re: iPhone/iOS push notifications upon download completion Script link not found

Post by computer »

Hey the script link is gone does someone have it?
thanks
cevhd
Newbie
Newbie
Posts: 4
Joined: December 2nd, 2009, 1:42 pm

Re: iPhone/iOS push notifications upon download completion Script link not found

Post by cevhd »

computer wrote: Hey the script link is gone does someone have it?
thanks
Might want to check out this:

https://github.com/Cev/sabnzbd-notifo

It's more or less the same thing. I'm working on a Prowl script now though, since the Prowl iOS app is much better than Notifo.
Post Reply