[PP-SCRIPT] Pushbullet notifications (Android, iOS, Chrome)

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.
JVM
Posts: 83
Joined: 21 Oct 2013, 05:11

Re: [PP-SCRIPT] Pushbullet notifications (Android, iOS, Chro

Post by JVM » 07 Oct 2014, 06:45

Hi binreader,

Thanks for your input :) I've tested the script in both the scan and pp script versions and far as I can tell it works well. That urllib2.urlopen() function does seem much better suited for working with more OS's instead of using curl externally. I was wondering if these scripts work with Windows. I imagine (as I only program casually) the message is still sent encrypted via HTTPS?

Plus nice idea with the name and status in the title. I've got Android stuff so never really had that issue, as it usually scrolls through the first few lines when a new push received.

With your categories option, I'm not sure if its needed as it's possible to define per category scripts via the categories settings page (eg Category1.PostScript)? I think it's better to have just per category scripts defined in the one place like with other scripts as it's easier to debug. Anyway I've left it for now.

I've attached it below as per your code, but with unix line endings so it works on my Raspberry Pi. I'm curious, does this script below (with Unix line endings) work with Windows?
binreader wrote: Summary
-No more curl requirement, not needed
-Option: Add nzb name to title
-Option: Add status tags to title
-Option: Skip specific categories
-Bugfix: Handle pause and top of queue messages
For NZBGet v14+:
    • Pushbullet.py
      V14 Version 1.0, 7 Oct 2014
      (18.96 KiB) Downloaded 404 times

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [PP-SCRIPT] Pushbullet notifications (Android, iOS, Chro

Post by hugbug » 07 Oct 2014, 08:27

Didn't tried this specific script but all other scripts use unix line endings and work on windows too.

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

Re: [PP-SCRIPT] Pushbullet notifications (Android, iOS, Chro

Post by binreader » 07 Oct 2014, 16:44

I will check the version you attach on windows later, should be fine.
Regarding encryption, I kept the same https url but I have no idea if those functions is encrypting credentials and stuff, someone more qualified may know but I will do some digging/research. I figured if they spent time adding all those fancy stuff to the library it should be good.

Regarding curl yah I think removing one barrier of adoption may get more user using these things.

I'm very new to nzbget, I did check out the ability to specify post processing at the category level. Which is neat. However there is no way to define the scan script stuff at the category level. So that why I add the skip category thing. Without it what would happen is yah can exclude the script for post processing on a category. But when the nzb would enter the queue the scan part of the script would still make an push for that category.

Did I miss some setting or maybe hugbug may add category level scan script ability?

JVM
Posts: 83
Joined: 21 Oct 2013, 05:11

Re: [PP-SCRIPT] Pushbullet notifications (Android, iOS, Chro

Post by JVM » 07 Oct 2014, 23:04

I was thinking on the same lines, I had a quick google and I imagine it is encrypted with that url.

Yeah I don't think there is a category specific scan script setting. Probably better just to leave the defined scan script categories in the script.

JVM
Posts: 83
Joined: 21 Oct 2013, 05:11

Re: [PP-SCRIPT] Pushbullet notifications (Android, iOS, Chro

Post by JVM » 08 Oct 2014, 12:25

For NZBGet v14+
  • Pushbullet.py is a pre- and post-download notification script for v14+. It is basically pushbulletnzbprocess.py and pushbullet.py in one.

    Compared to 13.0-r1031+, I have added options regarding [New Feature] Per-nzb time statistics, specifically average download speed (which is more reliable than 22 July 2014) and various times.

    Compared to older v14 scripts:
    binreader wrote: Summary
    -No more curl requirement, not needed
    -Option: Add nzb name to title
    -Option: Add status tags to title
    -Option: Skip specific scan script categories
    -Bugfix: Handle pause and top of queue messages
    To install Pushbullet.py, copy to your scripts folder. For a notification before a nzb is added to the queue, add Pushbullet.py under Settings, Extension Scripts, ScanScript. For a notification after job is completed, add Pushbullet.py under Settings, Extension Scripts, PostScript or Category, PostScript. Then add your Access Token on the Pushbullet settings page. Testing is the same as described for pushbullet.py in OP.
  • Pushbullet.py
    V14 Version 1.1.1, 28 Jan 2015
    (19.1 KiB) Downloaded 1565 times
    • Pushbullet.py
      V14 Version 1.1, 8 Oct 2014
      (19.1 KiB) Downloaded 489 times
[/size]
Last edited by JVM on 28 Jan 2015, 01:29, edited 1 time in total.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [PP-SCRIPT] Pushbullet notifications (Android, iOS, Chro

Post by hugbug » 08 Oct 2014, 19:13

binreader wrote:Did I miss some setting or maybe hugbug may add category level scan script ability?
Scan-scripts are global at the moment.
But the script could be modified to be Queue-script instead. In this case it could be selected as PostScript for categories.

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

Re: [PP-SCRIPT] Pushbullet notifications (Android, iOS, Chro

Post by binreader » 09 Oct 2014, 04:36

I tried the new official version on windows and it works fine.

The queue script idea sounds good to leverage the built in category handling to skip notifications on some categories. I guess their is no absolute reason why it has to use scan script as opposed to queue script as the notification will still occur in a timely fashion.

I will check out how one works and experiment.

JVM
Posts: 83
Joined: 21 Oct 2013, 05:11

Re: [PP-SCRIPT] Pushbullet notifications (Android, iOS, Chro

Post by JVM » 09 Oct 2014, 06:00

binreader wrote:I tried the new official version on windows and it works fine.
Cool, cheers. I forgot to mention that all I changed from the previous 1.0 was just adding to the description of the skip categories setting you added, specifying that it skips categories for scan notification only. The code was unchanged from your post.

Turning it into a queue script would be cool, as it's possible to monitor other stuff during the download, one thing that comes to my head is maybe size of the nzb reporting in scan notification, as I don't think that info is available in during the scan script run time, but it is at the first queue script call.

One thing though, wouldn't the script get called after every file of a nzb group downloaded, like the FakeDetector and PasswordDetector queue scripts, and the whole ~5sec python start up time would occur each time?

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [PP-SCRIPT] Pushbullet notifications (Android, iOS, Chro

Post by hugbug » 09 Oct 2014, 07:12

Yes, it would but the 5 sec. start up time happens only on very slow devices (like mine box) and it also can be controlled via option EventInterval.

I'm also thinking about adding an ability for scripts to explicitly define what events they are interested in, something like:

Code: Select all

### NZBGET QUEUE SCRIPT
### QUEUE EVENTS: NZB_ADDED, NZB_DOWNLOADED

JVM
Posts: 83
Joined: 21 Oct 2013, 05:11

Re: [PP-SCRIPT] Pushbullet notifications (Android, iOS, Chro

Post by JVM » 09 Oct 2014, 10:13

Yeah I see the same script start up on my Raspberry Pi, about 3-5 sec. I imagine that definition would work well in these scripts.

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests