Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with Growl for Windows #2

Closed
gibxxi opened this issue Jul 28, 2015 · 17 comments
Closed

Not working with Growl for Windows #2

gibxxi opened this issue Jul 28, 2015 · 17 comments
Assignees
Labels

Comments

@gibxxi
Copy link

gibxxi commented Jul 28, 2015

Already have Growl set up in Headphones, CouchPotato and Sonarr (NzbDrone) and all 3 work with Growl for Windows without issue.

However this script does not work. Tried doing a CLI test using the syntax:

python Notify.py -s growl://password@PC-IP-Address:23053 -t "Hello" -b "World"

A success message is generated, but no notification arrives at the opposite end. As I say, the other 3 apps with built-in support all work fine.

Also did the same CLI test but with the parameters adjusted for KODI. This works fine too. So eitther i'm specifying the command incorrectly, or there's a bug in the Growl portion of this code. Or it just isn't compatible with Growl for Windows.

@caronc caronc added the bug label Jul 28, 2015
@caronc caronc self-assigned this Jul 28, 2015
@caronc
Copy link
Owner

caronc commented Jul 28, 2015

This package is relatively young; so you're probably the first one to use Growl within it. Presently I'm just wrapping an old growl library i found on GitHub which I'll drop and convert over to the same ones the other apps you suggested work fine with (GNTP).

So on a side note, thanks for reporting this; it definitely sounds like a bug. I don't own a Mac, so hopefully you can test it out for me when I'm done.

@gibxxi
Copy link
Author

gibxxi commented Jul 28, 2015

I don't own a Mac either. :)

OK, didn't realize this was so fresh. Perhaps you might want to look at the code for CouchPotato/Sonarr/HeadPhones as I suspect they might all use the same "base". Why re-invent the wheel, right?

However, if you want me to do testing on it, i'll be happy to. Bear in mind I'm running NZBGet on a Linux-based NAS (specifically, an ASUStor AS5104T) and am sending notifications to (potentially) 3 different Windows 7 machines.

@caronc
Copy link
Owner

caronc commented Jul 29, 2015

@gibxxi It would be really cool of you if you would give your Growl test another try and let me know how it goes (at your convenience of course). Please use the master branch as your source! :).

@gibxxi
Copy link
Author

gibxxi commented Jul 29, 2015

No joy Chris. Now I'm getting no feedback from Notify.py either. No error messages, but just no messages at all. Cursor just moves to the next line in the terminal session after sending the command, and that's it. Still nothing coming up on the local Growl instance.

As before, KODI notifications (the only other supported protocol I can test) works as expected.

@caronc
Copy link
Owner

caronc commented Jul 29, 2015

Well that's a bit of a downer, I'll have another look this evening when I get home. Could you run the same CLI call (using Growl) with a --debug (or -D) added to it? That may or may not shed more light on what I did wrong. Hopefully I'll be able to spot an obvious error I made regardless.

Edit: I just found gol after Googling around. I'll install this and do my own testing instead of bugging you; hopefully it works. :)

@gibxxi
Copy link
Author

gibxxi commented Jul 29, 2015

Here's the script output (with de-bugging on):

[INFO] [DEBUG] Script mode forced off.
2015-07-29 23:25:02,088 - 13035 - DEBUG - get(default) SERVERS=None
2015-07-29 23:25:02,088 - 13035 - DEBUG - set(config) SERVERS="growl://password@192.168.0.6:23053"
2015-07-29 23:25:02,088 - 13035 - DEBUG - set(environment) SERVERS="growl://password@192.168.0.6:23053"
2015-07-29 23:25:02,088 - 13035 - DEBUG - get(default) TITLE=None
2015-07-29 23:25:02,088 - 13035 - DEBUG - set(config) TITLE="Hello"
2015-07-29 23:25:02,089 - 13035 - DEBUG - set(environment) TITLE="Hello"
2015-07-29 23:25:02,089 - 13035 - DEBUG - get(default) BODY=None
2015-07-29 23:25:02,089 - 13035 - DEBUG - set(config) BODY="World"
2015-07-29 23:25:02,089 - 13035 - DEBUG - set(environment) BODY="World"
2015-07-29 23:25:02,089 - 13035 - DEBUG - get(default) INCLUDEIMAGE=None
2015-07-29 23:25:02,089 - 13035 - DEBUG - get(config) SERVERS="growl://password@192.168.0.6:23053"
2015-07-29 23:25:02,090 - 13035 - DEBUG - get(config) SERVERS="growl://password@192.168.0.6:23053"
2015-07-29 23:25:02,090 - 13035 - DEBUG - get(config) TITLE="Hello"
2015-07-29 23:25:02,090 - 13035 - DEBUG - get(config) BODY="World"
2015-07-29 23:25:02,090 - 13035 - DEBUG - get(default) INCLUDEIMAGE=None
2015-07-29 23:25:02,090 - 13035 - DEBUG - get(config) SERVERS="growl://password@192.168.0.6:23053"
2015-07-29 23:25:02,092 - 13035 - DEBUG - Server parsed to: {'host': '192.168.0.6', 'user': 'password', 'query': None, 'url': 'growl://password@192.168.0.6:23053', 'path': None, 'fullpath': None, 'password': None, 'port': 23053, 'qsd': {}, 'schema': 'growl'}

Passwords replaced with 'password', everything else is as output.

@caronc
Copy link
Owner

caronc commented Jul 30, 2015

A simple mistake on my part that was obvious from your logs. I also successfully installed and got growl-over-linux to work for me so I could test it out. So... the good news; after these changes it works for me. Hopefully it will work for you too. Let me know how it goes.

@gibxxi
Copy link
Author

gibxxi commented Jul 30, 2015

BINGO! We have a Winner! lol.

Well done Chris, the CLI Test worked, and successfully "Registered" the app within Growl for Windows. So now when something eventually does get snatched hopefully i'll see the notification. If/when that happens I'll post another note here to let you know (shouldn't be more than about 24 hours) so then you can close this particular bug.

Awesome sauce, thanks again!

:)

Dan.

@gibxxi
Copy link
Author

gibxxi commented Jul 30, 2015

Unfortunately it looks like I was a bit premature in my optimism. The initial "Registration" notification worked, but a subsequent retry of the same command (just sent the same line), failed.

Just tried adding a series from Sonarr, and I'm getting all Sonarr's Growl notifications, but nothing from NZBGet. In case it's relevant I've added Notify.py to NZBGet via the categories section, and specified my credentials at the top on the options for Notify itself. I assume this is correct?

We're close, I can feel it. But at this point, it's still not sending notifications. One thing I did notice is that when sending the CLI command there was a substantial "pause" between sending the command, and the CLI returning with the next shell prompt.

Debug log from CLI command as follows:

[INFO] [DEBUG] Script mode forced off.
2015-07-30 04:05:42,559 - 11942 - DEBUG - get(default) SERVERS=None
2015-07-30 04:05:42,559 - 11942 - DEBUG - set(config) SERVERS="growl://password@192.168.0.6:23053"
2015-07-30 04:05:42,560 - 11942 - DEBUG - set(environment) SERVERS="growl://password@192.168.0.6:23053"
2015-07-30 04:05:42,560 - 11942 - DEBUG - get(default) TITLE=None
2015-07-30 04:05:42,560 - 11942 - DEBUG - set(config) TITLE="Test"
2015-07-30 04:05:42,560 - 11942 - DEBUG - set(environment) TITLE="Test"
2015-07-30 04:05:42,560 - 11942 - DEBUG - get(default) BODY=None
2015-07-30 04:05:42,560 - 11942 - DEBUG - set(config) BODY="Message"
2015-07-30 04:05:42,561 - 11942 - DEBUG - set(environment) BODY="Message"
2015-07-30 04:05:42,561 - 11942 - DEBUG - get(default) INCLUDEIMAGE=None
2015-07-30 04:05:42,561 - 11942 - DEBUG - get(config) SERVERS="growl://password@192.168.0.6:23053"
2015-07-30 04:05:42,561 - 11942 - DEBUG - get(config) SERVERS="growl://password@192.168.0.6:23053"
2015-07-30 04:05:42,561 - 11942 - DEBUG - get(config) TITLE="Test"
2015-07-30 04:05:42,562 - 11942 - DEBUG - get(config) BODY="Message"
2015-07-30 04:05:42,562 - 11942 - DEBUG - get(default) INCLUDEIMAGE=None
2015-07-30 04:05:42,562 - 11942 - DEBUG - get(config) SERVERS="growl://password@192.168.0.6:23053"
2015-07-30 04:05:42,564 - 11942 - DEBUG - Server parsed to: {'host': '192.168.0.6', 'user': 'password', 'query':one, 'url': 'growl://password@192.168.0.6:23053', 'path': None, 'fullpath': None, 'password': None, 'port': 2305 'qsd': {}, 'schema': 'growl'}
2015-07-30 04:05:42,564 - 11942 - DEBUG - Growl Payload: {'applicationName': 'NZBGet-Notify', 'defaultNotification: ['New Messages'], 'hostname': '192.168.0.6', 'notifications': ['New Updates', 'New Messages'], 'password': 'password', 'port': 23053}
2015-07-30 04:05:42,576 - 11942 - DEBUG - Growl server registration completed successfully.
2015-07-30 04:05:42,579 - 11942 - DEBUG - Growl notification sent successfully.

I also notice that the get(default) INCLUDEIMAGE parameter seems to be empty. Not sure if this is a requirement, but might pay to point it at NZBGet's main window logo just to rule it out.

@caronc
Copy link
Owner

caronc commented Jul 30, 2015

Don't worry about the INCLUDEIMAGE directive; it's only used from the command line. You can add -i to your test switch on the command line if you want to see it in action.

With respect to your issue; there is nothing unusual with your logs at this point. Everything looks pretty good based on the output. I've added some more debug information to wrap the notify() call itself which will hopefully shed more life on the situation. I'll set up some notifications of my own to launch from nzbget now that i have a Growl server of my own and keep you posted.

@gibxxi
Copy link
Author

gibxxi commented Jul 30, 2015

I got it working.

I rechecked the settings in Growl for Windows, and it seems as if NZBGet registered itself with 3 different categories.

  1. (All notifications)
  2. New Updates
  3. New Messages.

Under these three categories, for the first one and last one, the option "Enabled" was set to true. For "New Updates" the setting was set to "disabled". Enabled it, and now it works.

As i suspected, I'm getting no image passed through from NZBGet, so it shows the default one (A window with a gear icon in the center). NZBGet's icons are all embedded in one single png file, so it will be necessary for you to provide this icon separately as part of the script if you want the NZBGet logo added to the notification like happens with the other 3 apps. Since it's square and the right aspect ratio for a notifier type window, I'd suggest the old black-on-white NZBGet logo.

So the fault was at my end for this one (No great surprise there then, lol).

:)

@caronc
Copy link
Owner

caronc commented Jul 30, 2015

Perfect and good to hear. I thought I got the icon part working (it works for me when I test at home anyway). That all said, it is a very recent update i've done to make it possible on the master (one I pushed last night).

I'm not too familiar with Growl, so I'm open to any advice for changing how it interfaces with our environments. I pretty much just copied the example off their website. I don't suppose it's really necessary to register 2 types of messages since I'll always just be sending the notification as a 'New Message' anyway. I'll drop the 'Update Message' type from future registrations to the server.

As per the icon; with the latest master push, i added a flag ?version=1 or ?version=2. The default is version=2. One of the differences is, with version=1, the image is read into memory and streamed as part of the message (following the Growl v1.4 protocol). With v2 (and greater), a URL reference is passed to the location of the icon.
So as an example, you might try specifying: growl://password@hostname?version=1 and see if that works for you. Alternatively; icons just might work for you with the latest push i did.

Edit: If testing from the command line, you'll need to add the -i switch for it to work.

@gibxxi
Copy link
Author

gibxxi commented Jul 30, 2015

Adding the ?version= statement (directly after the port number) does not work. Even with the "-i" switch added after Notify.py. e.g:

python Notify.py -i -s growl://PASSWORD@192.168.0.6:23053?version=1 -t "Test" -b "Another Test"

This doesn't work. The notification is received, but without a custom icon. However, simply specifying the "-i" switch in the command line statement with no other changes from the standard command does work.

@caronc
Copy link
Owner

caronc commented Jul 30, 2015

Perfect, so your implementation is using v2.x (which is the default anyway). I just put in the v1.4 support 'in case'. Another side note (totally up to you to change this); but i made the default growl port to be 23053, so you don't even need to specify that on the CLI (or NZBGet) to make the syntax easier.

Unless you have any other issues, I'm just going to just go ahead and close this ticket. I'll eliminate the extra message registration type 'Update Message' and update some of the internal documentation (version= flag, etc) and probably package up a release this evening. I'll update the forums on NZBGet's site too. Thanks for your patients with resolving this thing! :)

@gibxxi
Copy link
Author

gibxxi commented Jul 30, 2015

No worries, glad I could be of assistance. :)

Just a thought, but I came to NZBGet very recently, from SABnzbd. You can also use python-based scripts like this there. However, I'm not sure the CLI nature of this tool will work for SAB users. You might want to consider the idea of adding config file support (like nzbtomedia) for those users to be able to just add the script to the necessary area in SABnzbd and read all the settings from a config. Just a parting idea.

Thanks again for your help anyway. We got there in the end. :)

@caronc caronc closed this as completed Jul 30, 2015
@caronc
Copy link
Owner

caronc commented Jul 30, 2015

@gibxxi i missed your first reply (above your last). With respect to Sab, a lot of the output of this tool is a result of data scraped from NZBGet. But the CLI alone is pretty general, so it wouldn't be hard for someone to wrap it if they needed to.

@gibxxi
Copy link
Author

gibxxi commented Jul 30, 2015

Probably, but that won't help somebody like me, waiting on a 3rd party to do it. It's just an idea for the future if you are looking for ways to broaden the appeal for this script. I like the way NZBGet integrates settings for scripts like this and Clinton's nzbtomedia script, but NZBGet isn't the easiest thing in the world to configure on it's own in the first place. First time I tried, I had to give up on it and go back to SAB. For me, this point is irrelevant as I'm now a NZBGet user, but there are a couple of things SAB still handles better, so it's an idea. Up to you at the end of the day. I'm just glad I found your script at all. The other one I was testing only supports Growl and didn't work at all.

:)

caronc added a commit that referenced this issue Aug 4, 2017
 Pushjet support (attempt #2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants