[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.
l2g
Posts: 205
Joined: 27 Jun 2014, 22:13
Contact:

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

Post by l2g » 25 Nov 2017, 17:51

JackD wrote:
25 Nov 2017, 17:19
However, I can feel the love and loyalty you have for your framework etc, and why you may be too close to it - blocking you from seeing what I see, which is a pity ;)
...
The project goal has far wider audience appeal used in CLI and without NZBGet.
Well i guess it wouldn't be too much effort to just take the url parser out of the framework and paste it into a new pnotify object and do all the management around that. Then the nzb-notify script becomes a 1 liner almost just relaying url's back to the pnotify backend. Could package it up and stick it on pypi too. I this what you're thinking

JackD
Posts: 11
Joined: 15 Jul 2016, 18:17

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

Post by JackD » 25 Nov 2017, 18:53

l2g wrote:
25 Nov 2017, 17:51
JackD wrote:
25 Nov 2017, 17:19
However, I can feel the love and loyalty you have for your framework etc, and why you may be too close to it - blocking you from seeing what I see, which is a pity ;)
...
The project goal has far wider audience appeal used in CLI and without NZBGet.
Well i guess it wouldn't be too much effort to just take the url parser out of the framework and paste it into a new pnotify object and do all the management around that. Then the nzb-notify script becomes a 1 liner almost just relaying url's back to the pnotify backend. Could package it up and stick it on pypi too. I this what you're thinking
You got it ;)
And the beauty is, with this level of separation/abstraction, you get to test develop in the mindset context of a developer using the pure pnotify package and interfacing that with a module (in your case, nzbget module) much like any other application developer will be doing. Though the name "pnotify" is a .js project so...

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

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

Post by l2g » 26 Nov 2017, 05:19

JackD wrote:
25 Nov 2017, 18:53
You got it ;)
And the beauty is, with this level of separation/abstraction, you get to test develop in the mindset context of a developer using the pure pnotify package and interfacing that with a module (in your case, nzbget module) much like any other application developer will be doing. Though the name "pnotify" is a .js project so...
Thanks for your feedback; while noting your comment about the "pnotify" being taken... so were "notify", "pushnotify", and "notifications". So I started porting (and re-factoring everything) as "apprise" which seemed original enough. I made significant headway on the back-end... well the re-factoring of it that is. No CLI yet; but i pushed it to pypi too just to secure the new name.

Anyway... in the meantime I just wanted to thank you for your advice. I only get weekends to tinker with this sort of thing, so hopefully I'll have something working by the new year.

Commander
Posts: 4
Joined: 27 Dec 2017, 14:59

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

Post by Commander » 27 Dec 2017, 15:12

Hello
please i need help with this script.
I put the Notify.py and the folder nzb.notify-0.6.1 in /scripts.

Now there is Email,Notify,Logger on nzbget Webinterface on the left side.

But if i try Test Server Configuration get following:

Code: Select all

Wed Dec 27 15:58:07 2017	INFO	Executing script Notify.py with command TestServers
Wed Dec 27 15:58:07 2017	INFO	Notify: Traceback (most recent call last):
Wed Dec 27 15:58:07 2017	INFO	Notify:   File "/opt/nzbget/scripts/Notify.py", line 309, in <module>
Wed Dec 27 15:58:07 2017	INFO	Notify:     from nzbget import SCRIPT_MODE
Wed Dec 27 15:58:07 2017	INFO	Notify: ImportError: No module named nzbget
Wed Dec 27 15:58:07 2017	ERROR	Script Notify.py with command TestServers failed (terminated with unknown status)


My Python Version is Python 2.7.12

Is ther something wrong to put the Notify.py in /scripts outside the nzb.notify-0.6.1 Folder?

Ok I try to copy Notify.py and the Folder Notify to /scripts. Now I got this:

Code: Select all


Executing script Notify.py with command TestServers
Notify: Traceback (most recent call last):
Notify:   File "/opt/nzbget/scripts/Notify.py", line 315, in <module>
Notify:     from pnotify import *
Notify:   File "/opt/nzbget/scripts/Notify/pnotify/__init__.py", line 26, in <module>
Notify:     from NotifyBoxcar import NotifyBoxcar
Notify:   File "/opt/nzbget/scripts/Notify/pnotify/NotifyBoxcar.py", line 23, in <module>
Notify:     import requests
Notify:   File "/opt/nzbget/scripts/Notify/requests/__init__.py", line 53, in <module>
Notify:     from urllib3.contrib import pyopenssl
Notify:   File "/opt/nzbget/scripts/Notify/urllib3/contrib/pyopenssl.py", line 53, in <module>
Notify:     import OpenSSL.SSL
Notify:   File "/opt/nzbget/scripts/Notify/OpenSSL/__init__.py", line 8, in <module>
Notify:     from OpenSSL import rand, crypto, SSL
Notify:   File "/opt/nzbget/scripts/Notify/OpenSSL/SSL.py", line 112, in <module>
Notify:     if _lib.Cryptography_HAS_SSL_ST:
Notify: AttributeError: 'module' object has no attribute 'Cryptography_HAS_SSL_ST'
Script Notify.py with command TestServers failed (terminated with unknown status)

Close
Hope someone can help me.

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

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

Post by l2g » 27 Dec 2017, 16:16

There is an issue with your copy of OpenSSL. Here is a similar issue which might help.

What OS are you using?

Commander
Posts: 4
Joined: 27 Dec 2017, 14:59

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

Post by Commander » 28 Dec 2017, 14:42

Yes thank. I reinstall OpenSSL and now it work`s fine.
I try to send Notifications to Telegram. Great. But can`t send to another Telegram Bot.
So i try json but is there an example how json works?

Commander
Posts: 4
Joined: 27 Dec 2017, 14:59

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

Post by Commander » 28 Dec 2017, 15:20

Ok I found another problem. If Nzbget start with Systemd on Systemboot the Notifications doesn`t work. I think the OpenSSL isn`t load if nzbget is started. If I start NZBget manuell all work`s fine.

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

Testing Notifications (All In One) Refactoring

Post by l2g » 28 Jan 2018, 21:42

Earlier in the comments, a kind individual challenged me to break apart the notification part of this script into an independent package that anyone can use in their application. Thank you JackD; this is done now and seems to be really stable now! The new package is called Apprise.

I apologize for bumping this thread to the top, but I'm just calling on help from all of you now. By changing NZB-Notify to just include Apprise and eliminating all of the redundant code: ~4000 lines of python code removed!

I would really appreciate if anyone who uses this script would be willing to test this new version using the special branch it resides in. I want to move this into the master (branch) and tag it as a newer version once i have confirmation I'm not going to hose all of the existing users. ;)

Here is the branch this new code resides in and here is a link to the direct download.

All of these changes work great for me (famous last words of any developer), but (again), i would really (,really) appreciate anyone else's feedback.

grainybazzles
Posts: 2
Joined: 11 Feb 2018, 20:39

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

Post by grainybazzles » 11 Feb 2018, 21:11

I switched to the apprise version and things seem to be in order. Notifications via pushbullet work on queue. But the post-process notifications do not. Here's the error I get:

ERROR Sun Feb 11 2018 09:04:37 Post-process-script nzb-notify/Notify.py for WEB-DL.DDP5.1.H.264-NTb-Obfuscated failed
ERROR Sun Feb 11 2018 09:04:36 Notify: NameError: global name 'NOTIFY_NEWLINE' is not defined
INFO Sun Feb 11 2018 09:04:36 Notify: body += NOTIFY_NEWLINE + 'Status: %s' % str(self.status)
ERROR Sun Feb 11 2018 09:04:36 Notify: File "/mnt/dietpi_userdata/nzbget/scripts/nzb-notify/Notify.py", line 518, in postprocess_main
INFO Sun Feb 11 2018 09:04:36 Notify: exit_code = main_function(*args, **kwargs)
ERROR Sun Feb 11 2018 09:04:36 Notify: File "/mnt/dietpi_userdata/nzbget/scripts/nzb-notify/Notify/nzbget/ScriptBase.py", line 3043, in run
ERROR Sun Feb 11 2018 09:04:36 Notify: Traceback (most recent call last):

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

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

Post by l2g » 11 Feb 2018, 22:18

grainybazzles wrote:
11 Feb 2018, 21:11
But the post-process notifications do not.
Thank you for your feedback! :) I really appreciate it!

I pushed a small fix (apprise is now part of the master branch) for this; you can grab the latest here: (quick link)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest