caronc / nzb-notify

Push Notifications to a large number of supported services for NZBGet and SABnzbd (based on Apprise)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Registers with Growl for Windows but sends no messages

fragande opened this issue Β· comments

Sabnzbd removed support for Growl (which I've been using forever) in 3.0.0, so I'm trying to use nzb-notify instead. Running into issues though. When trying the following command:

python sabnzbd-notify.py complete 'Hello' 'World' growl://*password*@127.0.0.1

OR

python Notify.py -s growl://*password*@127.0.0.1 -t "Hello" -b "World"

I get a notification from Growl that NZB-Notify successfully registered with Growl to send notifications, but no message is shown. If I then run the command again nothing happens whatsoever. Trying to use sabnzbd-notify.py in sabnzbd with the parameter growl://*password*@127.0.0.1 returns Notification sent! (and registers with Growl if not already registered), but once again no messages are shown after that.

If I run python Notify.py -s growl://*password*@127.0.0.1 -t "Hello" -b "World" -D the output is as follows:

2020-08-02 08:02:14,767 - 14276 - DEBUG - Script Mode: shell
2020-08-02 08:02:14,767 - 14276 - DEBUG - Python v2.7.16
2020-08-02 08:02:14,772 - 14276 - DEBUG - OS: Windows 10
2020-08-02 08:02:14,773 - 14276 - DEBUG - get(default) SERVERS=None
2020-08-02 08:02:14,773 - 14276 - DEBUG - set(config) SERVERS="growl://*password*@127.0.0.1"
2020-08-02 08:02:14,773 - 14276 - DEBUG - set(environment) SERVERS="growl://*password*@127.0.0.1"
2020-08-02 08:02:14,773 - 14276 - DEBUG - get(default) TITLE=None
2020-08-02 08:02:14,775 - 14276 - DEBUG - set(config) TITLE="Hello"
2020-08-02 08:02:14,775 - 14276 - DEBUG - set(environment) TITLE="Hello"
2020-08-02 08:02:14,776 - 14276 - DEBUG - get(default) BODY=None
2020-08-02 08:02:14,776 - 14276 - DEBUG - set(config) BODY="World"
2020-08-02 08:02:14,776 - 14276 - DEBUG - set(environment) BODY="World"
2020-08-02 08:02:14,778 - 14276 - DEBUG - get(default) INCLUDEIMAGE=None
2020-08-02 08:02:14,778 - 14276 - DEBUG - get(config) SERVERS="growl://*password*@127.0.0.1"
2020-08-02 08:02:14,779 - 14276 - DEBUG - get(config) TITLE="Hello"
2020-08-02 08:02:14,779 - 14276 - DEBUG - get(config) BODY="World"
2020-08-02 08:02:14,779 - 14276 - DEBUG - get(default) INCLUDEIMAGE=None
2020-08-02 08:02:14,779 - 14276 - DEBUG - get(default) INCLUDEIMAGE=None
2020-08-02 08:02:14,780 - 14276 - DEBUG - get(config) SERVERS="growl://*password*@127.0.0.1"
2020-08-02 08:02:14,842 - 14276 - DEBUG - Exiting with return code: 0

Hi, your issue seems very close to an open issue here. If you could see if the new Apprise changes work at all, we might be able to kill 2 birds with one stone. I don't have Growl to test with at this time, so I'm reaching out to people just like yourself to help me out. The below is copied and pasted from the link i shared above; if you could test to see if your growl notifications work this way; it won't take much effort to get this working in nzb-notify too.

# Create a virtual environment to work in
# This way you can just destroy it after when it's all over.
# It will create a directory called apprise
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install our branch:
pip install git+https://github.com/caronc/apprise.git@251-growl-missing-notification-header

# install just gntp
pip install gntp

# Give it a go:
apprise -t "Title" -b "Body" growl://{your_details}

No luck, but I'm not very handy with this stuff. I'm running Windows and using Python 2.7 virtualenv gives the following error when running apprise -t "Hello" -b "World" growl://{my_details}:


Traceback (most recent call last):
  File "c:\users\user\envs\testrise3\lib\site-packages\apprise\Apprise.py", line 393, in notify
    attach=attach):
  File "c:\users\user\envs\testrise3\lib\site-packages\apprise\plugins\NotifyBase.py", line 268, in notify
    notify_type=notify_type, attach=attach):
  File "c:\users\user\envs\testrise3\lib\site-packages\apprise\plugins\NotifyGrowl.py", line 259, in send
    if not self.growl and not self.register():
  File "c:\users\osen\user\testrise3\lib\site-packages\apprise\plugins\NotifyGrowl.py", line 211, in register
    self.growl = gntp.notifier.GrowlNotifier(**payload)
AttributeError: 'module' object has no attribute 'notifier'

Thinking maybe apprise requires Python 3 I installed the latest Python 3 package but get the following error when trying to build:

    ERROR: Command errored out with exit status 1:
     command: 'f:\pythonvirt\testrise3\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-req-build-zxar8819\\setup.py'"'"'; __file__='"'"'C:\\Users\\user\\AppData\\Local\\Temp\\pip-req-build-zxar8819\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\user\AppData\Local\Temp\pip-pip-egg-info-n5brbq3i'
         cwd: C:\Users\user\AppData\Local\Temp\pip-req-build-zxar8819\
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\user\AppData\Local\Temp\pip-req-build-zxar8819\setup.py", line 68, in <module>
        long_description=open('README.md').read(),
      File "C:\Python38\lib\encodings\cp1252.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 24960: character maps to <undefined>
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

EDIT:

Successfully built in Debian virtual machine using Python 3.7, but I get the following error (almost identical to the Windows Python 2.7 one):

(testrise) root@user-PC:/mnt/f/wsl/userdeb/envs# apprise -t "Title" -b "Body" growl://{my_details}
2020-08-03 06:36:43,261 - ERROR - Notification Exception
Traceback (most recent call last):
  File "/mnt/f/wsl/userdeb/envs/testrise/lib/python3.7/site-packages/apprise/Apprise.py", line 393, in notify
    attach=attach):
  File "/mnt/f/wsl/userdeb/envs/testrise/lib/python3.7/site-packages/apprise/plugins/NotifyBase.py", line 268, in notify    notify_type=notify_type, attach=attach):
  File "/mnt/f/wsl/userdeb/envs/testrise/lib/python3.7/site-packages/apprise/plugins/NotifyGrowl.py", line 259, in send
    if not self.growl and not self.register():
  File "/mnt/f/wsl/userdeb/envs/testrise/lib/python3.7/site-packages/apprise/plugins/NotifyGrowl.py", line 211, in register
    self.growl = gntp.notifier.GrowlNotifier(**payload)
AttributeError: module 'gntp' has no attribute 'notifier'

No luck, but I'm not very handy with this stuff.

Honestly, you're doing a fine job and i really appreciate you helping me here! πŸ‘ Apprise supports Python 2.7 and Python v3.5 and newer. That middle error you're getting is a really strange one (maybe just a one-off?); for now I'll focus on this error:

AttributeError: 'module' object has no attribute 'notifier'

I believe i just fixed this now; can you run the steps above again and give it another go? Alternatively, you can just activate your existing virtual environment and do a git pull; that should pull in the latest updates.

Thanks again for all of your help! Let me know how it goes.

No errors, but same behaviour as in the initial report I'm afraid (i.e. Apprise registers with Growl but sends no message or notification beyond the initial successfully registered one).

Interesting, do you get any error message? You may need to add -vvvv to the switch for this to work.

Edit: this error seems similar (and might be related to your issue. Have a look and let me know.

Yes, that does seem to indicate an error:

2020-08-04 15:08:05,177 - TRACE - Growl URL growl://{my_details} unpacked as:
secure="False"
qsd="{}"
sticky="True"
host="*myserverIP"
user="*mypassword*"
path="None"
query="None"
password="*mypassword*"
port="None"
include_image="True"
qsd+="{}"
qsd-="{}"
url="growl://{my_details}"
verify="True"
fullpath="None"
schema="growl"
2020-08-04 15:08:05,177 - DEBUG - Loaded Growl URL: growl://{my_details}/?priority=normal&image=yes&version=2&sticky=yes&privacy=False
2020-08-04 15:08:05,177 - DEBUG - Growl Registration Payload: {'applicationName': 'Apprise', 'defaultNotifications': ['New Messages'], 'hostname': u'*myserverIP*', 'notifications': ['New Messages'], 'password': u'*mypassword*', 'port': 23053}
2020-08-04 15:08:05,187 - DEBUG - Growl server registration completed successfully.
2020-08-04 15:08:05,188 - DEBUG - Growl Payload: {'description': 'Title\r\nBody', 'title': '', 'sticky': True, 'priority': 0, 'noteType': 'New Messages', 'icon': True}
2020-08-04 15:08:05,188 - WARNING - A Connection error occurred sending Growl notification to *myserverIP*.
2020-08-04 15:08:05,194 - DEBUG - Growl Exception: Missing Notification Header: Notification-Title

I checked out the link, but I only have (All notifications) and New Messages registered as notification types for Apprise. Both are set to Enabled: True. Two things strike me as a bit odd here, the first is user="*mypassword*", but that may be intended? The second is that the 'title': '' part of the payload is empty. The exception is Missing Notification Header: Notification-Title so maybe that could be the issue here?

I think I found the issue. Can you do a git pull and update your branch one more time and give it one more shot?

I'm not sure how to do a git pull, all I get in the virtualenv is: fatal: not a git repository (or any of the parent directories): .git

But I made a new virtualenv and now it does indeed seem to be working, great work πŸ‘ I get a notification from Apprise with the correct title and body. Output is as follows:

2020-08-04 16:47:15,361 - TRACE - Growl URL growl://{my_details} unpacked as:
secure="False"
qsd="{}"
sticky="True"
host="*myserverIP*"
user="*mypassword*"
path="None"
query="None"
password="*mypassword*"
port="None"
include_image="True"
qsd+="{}"
qsd-="{}"
url="growl://{my_details}"
verify="True"
fullpath="None"
schema="growl"
2020-08-04 16:47:15,361 - DEBUG - Loaded Growl URL: growl://{my_details}/?priority=normal&image=yes&version=2&sticky=yes&privacy=False
2020-08-04 16:47:15,361 - DEBUG - Growl Registration Payload: {'applicationName': 'Apprise', 'defaultNotifications': ['New Messages'], 'hostname': u'*myserverIP*', 'notifications': ['New Messages'], 'password': u'*mypassword*', 'port': 23053}
2020-08-04 16:47:15,403 - DEBUG - Growl server registration completed successfully.
2020-08-04 16:47:15,404 - DEBUG - Growl Payload: {'description': u'World', 'title': u'Hello', 'sticky': True, 'priority': 0, 'noteType': 'New Messages', 'icon': True}
2020-08-04 16:47:15,881 - INFO - Sent Growl notification.

Could this fix be added to nzb-notify?

Could this fix be added to nzb-notify?

nzb-notify wraps Apprise. So you could access the same server/container and just do the following to get up and going:

pip install git+https://github.com/caronc/apprise.git@251-growl-missing-notification-header

Thank you for all of your help and troubleshooting; I really do appreciate it. I'll do a new release of Apprise soon and then it will just become part of PyPi.

Ah yes, sorry. Thank you for having patience with a knucklehead like me. I have my SABnzbd notifications back, success! πŸ˜ƒ

Some minor observations:

  • There's no sabnzbd icon on the notification (don't know if there's supposed to be or not). No icon at all.
  • Pausing and resuming are both under the title SABnzbd: Added NZB.

But that's just minor annoyances.

No need to thank me, I'm the one who should be thanking you πŸ‘

Try adding ?version=1 to the end of your Apprise URL and give it another shot. Maybe I should make this a default setting... unfortunately different versions of Growl take different options as per how the icon works.

That works when running Apprise directly, e.g. apprise -t "Hello" -b "World" growl://{my_details}?version=1. Then the Apprise icon is shown and saved in Growl's AppData folder, but a notification from SABnzbd (or manually running sabnzbd-notify.py) only results in the default Growl gear icon. Doesn't seem to pass the SABnzbd icon.

Looking back at the source code, it actually looks like SABNzbd images (read off of disk) were never supported. 😲 I'm surprised you're the first one to report this; this bug you're noticing would have been in place for years and years. I'll create another bug report (instead of tailing onto this one) and reference back to your observation.

Hi! I'm just closing off this ticket since it has been resolved.
I'm working on the Icon thing right now and it has it's own ticket already πŸ™‚