iPhone notification via Prowl [Windows script]

Come up with a useful post-processing script? Share it here!
relman
Release Testers
Release Testers
Posts: 53
Joined: September 30th, 2008, 2:42 am

Re: iPhone notification via Prowl [Windows script]

Post by relman » September 25th, 2011, 1:28 pm

Hi Sorry for the late reply, should have PM'ed me.

try this

Code: Select all

set API="79c7bb8e283752fbc0f4b5b0fceXXXXXX"
set priority=2
set desc=%3

cscript E:\usenet\scripts\prowl.vbs %API% %priority% %desc%
change the last bit to point to the vbs file. I think the code to script out non standard characters is messing up as you are using german OS

idmanager
Newbie
Newbie
Posts: 11
Joined: December 12th, 2010, 2:47 pm

Re: iPhone notification via Prowl [Windows script]

Post by idmanager » November 4th, 2011, 3:04 pm

anybody running a qnap server with python here is a script i run
just add your api key

Code: Select all

#!/usr/bin/env python
import sys,urllib

# Get clean NZB name
job_name = sys.argv[3]

# Prowl API settings - http://prowl.weks.net/api.php
# Set Prowl API
API = "enter the prowl api key here "
# Set Prowl priority. 0 - Normal, 2 - Emergency, -2 - Very Low
priority = "0"

# Set job title/event name
job_title = "Download%20Complete"

# Get current date/time and strip spaces
from time import gmtime, strftime
event_time = strftime("%d/%m/%y %H:%M")
event_time=event_time.replace(' ', '%20')

# URL encode chars from NZB name that cause issues
job_name=job_name.replace(' ', '%20')
job_name=job_name.replace('_', '%20')
job_name=job_name.replace('.', '%20')

# Send download complete notification to iPhone - swap 'job_title' for 'event_time' if completion time is required instead of 'Download Complete'
urllib.urlopen("https://prowl.weks.net/publicapi/add?apikey=" + API + "&priority=" + priority + "&application=SABnzbd&event=" + job_title + "&description=" + job_name)

SplitFire
Newbie
Newbie
Posts: 2
Joined: January 19th, 2012, 10:32 pm

Re: iPhone notification via Prowl [Windows script]

Post by SplitFire » January 19th, 2012, 10:36 pm

Would anyone know why I get this error when trying to run the windows prowl script?

msxml3.dll: Access is denied

Thanks!

I got the issue figured out and have rewritten the script. The following code should work for everyone...

prowl.cmd

Code: Select all

set API="xxxxxxxxxxxxxxxxx"

Set Item=%3
setlocal enableextensions
set var_=%Item%
endlocal & set FileName=%var_%
Set desc="%FileName%"
set priority=0

cscript C:\prowl.vbs %API% %priority% %desc%
prowl.vbs

Code: Select all

API = WScript.Arguments.Item(0)
priority = WScript.Arguments.Item(1)
desc = WScript.Arguments.Item(2)

set oHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")  
oHTTP.open "Get", "https://api.prowlapp.com/publicapi/add?" & "apikey=" & API & "&priority=" & priority & "&application=SABnzbd File Downloaded&event=" & Date() & " " & Time()  & "&description=" & desc ,false  
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"  
oHTTP.send  
HTTPPost = oHTTP.responseText

daven1985
Newbie
Newbie
Posts: 5
Joined: January 31st, 2012, 4:54 pm

Re: iPhone notification via Prowl [Windows script]

Post by daven1985 » January 31st, 2012, 4:56 pm

Morning,

I am very new to using SABnzbd and so far don't know why I bothered with sites like Fileserve and the like.

However I can't seem to figure out how I actually load a script into SABnzbd. Is they a guide to show me how to do this.

User avatar
shypike
Administrator
Administrator
Posts: 21039
Joined: January 18th, 2008, 12:49 pm

Re: iPhone notification via Prowl [Windows script]

Post by shypike » January 31st, 2012, 5:38 pm


daven1985
Newbie
Newbie
Posts: 5
Joined: January 31st, 2012, 4:54 pm

Re: iPhone notification via Prowl [Windows script]

Post by daven1985 » February 1st, 2012, 3:37 am

I went through that, I still can't figure what I need to do.

Sorry people, I am a complete novice with this and while I know how to look at scripts and have it working in terms of sending a test alert manually, I don't know how to load it into sabnzbd.

Thanks.

User avatar
shypike
Administrator
Administrator
Posts: 21039
Joined: January 18th, 2008, 12:49 pm

Re: iPhone notification via Prowl [Windows script]

Post by shypike » February 1st, 2012, 11:08 am

You don't "load it into" SABnzbd.
Make sure you set up a scripts folder in Config->Folders and put all the scripts in that folder.
Then SABnzbd will show a scripts column in queue, RSS and categories.
Only script that are executable (OSX, Linux) or have registered executable extensions (Windows: cmd, bat, exe etc.) will be shown.

daven1985
Newbie
Newbie
Posts: 5
Joined: January 31st, 2012, 4:54 pm

Re: iPhone notification via Prowl [Windows script]

Post by daven1985 » February 1st, 2012, 6:37 pm

skypike,

Thank you. That was exactly what I needed to hear and it is working.

However the only issue I have is that all of the prowl's just come up as t= (t is curvy). it doesn't put the name of the file into the prowl. Am I missing something.

Thanks for everyones help so far.

daven1985
Newbie
Newbie
Posts: 5
Joined: January 31st, 2012, 4:54 pm

Re: iPhone notification via Prowl [Windows script]

Post by daven1985 » February 20th, 2012, 4:16 am

Any thoughts ????? above post.

User avatar
shypike
Administrator
Administrator
Posts: 21039
Joined: January 18th, 2008, 12:49 pm

Re: iPhone notification via Prowl [Windows script]

Post by shypike » February 20th, 2012, 5:43 pm

Is this with non plain ASCII characters?
Like é, é etc.

dubud
Newbie
Newbie
Posts: 2
Joined: February 21st, 2012, 3:17 pm

Re: iPhone notification via Prowl [Windows script]

Post by dubud » February 21st, 2012, 3:19 pm

Anyone know how I can send notification to more of one Prowl API ?

Thx O0

daven1985
Newbie
Newbie
Posts: 5
Joined: January 31st, 2012, 4:54 pm

Re: iPhone notification via Prowl [Windows script]

Post by daven1985 » February 21st, 2012, 9:24 pm

Morning,

I have attached a screenshot of the prowl's on my iPhone.

Image

TannerG
Newbie
Newbie
Posts: 1
Joined: March 30th, 2012, 3:45 pm

Re: iPhone notification via Prowl [Windows script]

Post by TannerG » March 30th, 2012, 3:50 pm

SplitFire wrote:Would anyone know why I get this error when trying to run the windows prowl script?

msxml3.dll: Access is denied

Thanks!

I got the issue figured out and have rewritten the script. The following code should work for everyone...

prowl.cmd

Code: Select all

set API="xxxxxxxxxxxxxxxxx"

Set Item=%3
setlocal enableextensions
set var_=%Item%
endlocal & set FileName=%var_%
Set desc="%FileName%"
set priority=0

cscript C:\prowl.vbs %API% %priority% %desc%
prowl.vbs

Code: Select all

API = WScript.Arguments.Item(0)
priority = WScript.Arguments.Item(1)
desc = WScript.Arguments.Item(2)

set oHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")  
oHTTP.open "Get", "https://api.prowlapp.com/publicapi/add?" & "apikey=" & API & "&priority=" & priority & "&application=SABnzbd File Downloaded&event=" & Date() & " " & Time()  & "&description=" & desc ,false  
oHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"  
oHTTP.send  
HTTPPost = oHTTP.responseText


I got this to work, but the file names are incomplete. ie if the name of the download was "How I Met Your Mother", prowl will only show "How". So it only shows the first word.

Anyone know what I can do to fix this?

JohnSCS
Newbie
Newbie
Posts: 42
Joined: August 17th, 2009, 12:23 am

Re: iPhone notification via Prowl [Windows script]

Post by JohnSCS » April 2nd, 2012, 6:51 am

TannerG,

You need to make the desc URL encoded. It's seeing spaces as another parameter.
ie %20 for a space. Look at the original python script.


Dubud,

Add more APIs to the set API string separated by commas.
Ie, set API="API1,API2,API3"

solonvault
Newbie
Newbie
Posts: 14
Joined: July 6th, 2012, 4:50 am

Re: iPhone notification via Prowl [Windows script]

Post by solonvault » July 18th, 2012, 1:24 am

First of all great work on this script!

Is there a way to add the remaining Harddrive space to the notification ?

Thanks!

Post Reply