[Windows] Pushbullet Notifications

Come up with a useful post-processing script? Share it here!
Post Reply
NovaPost
Newbie
Newbie
Posts: 1
Joined: February 10th, 2015, 2:30 pm

[Windows] Pushbullet Notifications

Post by NovaPost »

Hello,

I couldn't find a script to send Pushbullets on Windows, sabToPushBullet by spants didn't work. I played with it a bit and decided I may as well start from scratch for Windows. Then spotted Twitter Notification for Windows by mookydudz and modified his code to work with Pushbullet.

***Credits****
Mookydudz creator of [Windows] Twitter Notifications

***Instructions***
The only thing you need is CURL for Windows which you can find here: http://curl.haxx.se/download.html

1. Put CURL in your SABnzbd folder or ensure it's in your PATH Enviroment variables in Windows. You could also alter CURL in the batch file to show its full path.

2. Open a text editor and copy & paste the following (Notepad will do) :

Code: Select all

REM - Sabnzbd PushBullet post-processing script for Windows
REM - Add your api key and the deviceid of the device to receive the notifcation below. Leave blank to send to all devices.

CLS

SET api=
SET deviceid=

SET status=%7
SET zero=0
SET filename=%3
SET filename=%filename: ="%
IF %status% EQU %zero% (GOTO :SUCCESS) ELSE (GOTO :FAIL)
:SUCCESS
SET title=Sabnzbd - Download Successfull
SET msg=Sabnzbd - Successfully downloaded %filename%
curl https://api.pushbullet.com/api/pushes -u "%api%": -d device_iden="%deviceid%" -d type=note -d title="%title%" -d body="%msg%" -X POST -k -s -S
EXIT
:FAIL
SET title=Sabnzbd - Download Failed
SET msg=Sabnzbd - Failed to download %filename%
curl https://api.pushbullet.com/api/pushes -u "%api%": -d device_iden="%deviceid%" -d type=note -d title="%title%" -d body="%msg%" -X POST -k -s -S
EXIT
3. Add your api key after "api=" and the deviceid of the device you want to send the Pushbullet to after "deviceid=". If you want to send to all devices leave it blank.

4. Save as "sabPushbulletWin.bat" in your post-processing script folder.

5. Assign it to a category, so it runs after your download has completed.
blun7
Newbie
Newbie
Posts: 26
Joined: June 7th, 2008, 10:35 am

Re: [Windows] Pushbullet Notifications

Post by blun7 »

So simple and works great! Much thx
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: [Windows] Pushbullet Notifications

Post by shypike »

PushBullet support will be in release 0.8.0
blun7
Newbie
Newbie
Posts: 26
Joined: June 7th, 2008, 10:35 am

Re: [Windows] Pushbullet Notifications

Post by blun7 »

shypike wrote:PushBullet support will be in release 0.8.0
Great news!
scope
Newbie
Newbie
Posts: 32
Joined: November 29th, 2009, 4:20 am

Re: [Windows] Pushbullet Notifications

Post by scope »

@shypike: Pushbullet support works fine in the latest Beta, however, and Im not sure if it is by design, if you are checking the nzb before downloading a ("Check before download" option) the notification is added twice ("SABnzbd: Added NZB"), I am assuming this is one for when it is actually added (and checked), and once it has passed checking and starts the actual download.. I think it would be better if we only got the notification once - when adding it to SABnzbd.

Other than that, great news and great implementation. :)
scope
Newbie
Newbie
Posts: 32
Joined: November 29th, 2009, 4:20 am

Re: [Windows] Pushbullet Notifications

Post by scope »

actually there is one more thing.. It seems to ignore the device id and send the notification to all devices.. I have compared it to CP and with Sabnzbd I get the notification on both my mobile and desktop, with CP I only get it on my phone.. I have the same Device ID set in the configuration.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: [Windows] Pushbullet Notifications

Post by shypike »

scope wrote: the notification is added twice ("SABnzbd: Added NZB"),
That will be fixed. Probably happens for all services, not just PushBullet.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: [Windows] Pushbullet Notifications

Post by shypike »

scope wrote:actually there is one more thing.. It seems to ignore the device id and send the notification to all devices.. I have compared it to CP and with Sabnzbd I get the notification on both my mobile and desktop, with CP I only get it on my phone.. I have the same Device ID set in the configuration.
Which program does it the right way?
scope
Newbie
Newbie
Posts: 32
Joined: November 29th, 2009, 4:20 am

Re: [Windows] Pushbullet Notifications

Post by scope »

shypike wrote:
scope wrote:actually there is one more thing.. It seems to ignore the device id and send the notification to all devices.. I have compared it to CP and with Sabnzbd I get the notification on both my mobile and desktop, with CP I only get it on my phone.. I have the same Device ID set in the configuration.
Which program does it the right way?
CP=Couch Potato.. I've got both set up to use Pushbullet and CP seems to use the device ID, where as Sabnzbd seems to ignore it.
Post Reply