Page 14 of 14

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

Posted: 12 Feb 2019, 20:43
by b0mb
When i send a telegram message with dl stats i get an error because the message is too long...

so it would be nice if you could the script making split messages longer than 4096 bytes ;)

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

Posted: 16 Feb 2019, 06:23
by l2g
@douche: Thank you for being so patient. I will try to have a look at this and push an update to nzb-notify soon.

@b0mb: This was a very large undertaking, but i 'think' I've implemented it in a development branch of apprise (which is what nzb-notify is based on now-a-days). The only problem with this request (and splitting the message into smaller sizes) is there is no way i can ever know the proper place to 'cut' the message.

I could cut it right in the middle of an html tag or mid sentence. I haven't gone through all the additional logic needed to get smart where the cut takes place. The thing is, services like telegram expect the content to arrive in an HTML format. It doesn't accept ill formatted messages and this can/will happen once we start snipping it up :). So while this will be a new feature i'll unveil hopefully in the next release, it comes with it's caveats.

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

Posted: 16 Feb 2019, 20:22
by l2g
@douche: You issue should be fixed in the latest code sitting in the master branch of NZB-Notify here. I've stripped out all of the provided dependencies in the latest release though as well. You'll need to make sure you do the following though first:

Code: Select all

# This must be done on the same node as NZB-Notify is installed on
# The requirements are really light weight:
#  - apprise
#  - pynzbget
#  - chardet
pip install -i requirements.txt
@b0mb: I'm going to need more time on this; but I'm getting close. Here is the link the the Apprise branch you can pull into your system if you want to try what is present sooner. You just need to change the overflow method; this is done in the URL.
  • overflow=upstream : this is the default (and used if no overflow over-ride is specified). Simply send all message content upstream and let that service handle the data. Some handle this well, others don't (like you're finding with Telegram).
  • overflow=truncate : Force there still to be only one single message pushed upstream, but ensure that it's contents fit within the remote servers criteria. If you send 1000 characters to a server only expecting 100, then with this flag set, 900 characters will be truncated. You will in fact just send the first 100 characters.
  • overflow=split : Similar to truncate, however the whole message will make it's way to the remote server split into as many smaller messages as it will take to do so.
Those are the only 3 i can think of for now (as per how one might want their data handled). split and truncate currently are not smart. They do not carefully carve their messages around words and/or HTML tags.

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

Posted: 08 Apr 2019, 22:09
by douche
l2g wrote:
16 Feb 2019, 20:22
@douche: You issue should be fixed in the latest code sitting in the master branch of NZB-Notify here. I've stripped out all of the provided dependencies in the latest release though as well. You'll need to make sure you do the following though first:

Code: Select all

# This must be done on the same node as NZB-Notify is installed on
# The requirements are really light weight:
#  - apprise
#  - pynzbget
#  - chardet
pip install -i requirements.txt
Thanks for the update - I'll see about making the update on my system.
Cheers

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

Posted: 19 Jul 2019, 22:42
by l2g
It's been a while, so I felt the need to update this script and slap a new build number on it.

Release v0.9.3 (Direct Download Link) is now in place.

The release details (and new documentation) can be found at the head of this thread (quick link). I added all of the new supported notification services here; there are more then 40 of them now (as of today).

Only 2 really major changes with this release:
  • it is it's fully Python 3 compatible (in addition to still being backwards compatible with v2).
  • it no longer ships with all of it's dependencies but instead includes a requirements.txt file. You will be required (just 1 time) to install them with

    Code: Select all

    pip install -r requirements.txt
    . While this may seem annoying, it only has to be done once. But when done again later, you'll get new security patches... and even more notification services as they become available through Apprise.

Happy notifying! :)

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

Posted: 21 Sep 2019, 09:04
by chanster
I was able to install your script into my nzbget installation and everything works in the command line (I'm using Telegram). However, when I try to add the script into nzbget, I'm getting the following error messages when I try to test the connection :
Executing script Notify.py with command TestServers
Notify: Traceback (most recent call last):
Notify: File "/downloads/scripts/Notify.py", line 181, in <module>
Notify: from apprise import Apprise
Notify: File "/usr/lib/python2.7/site-packages/apprise/__init__.py", line 49, in <module>
Notify: from .Apprise import Apprise
Notify: File "/usr/lib/python2.7/site-packages/apprise/Apprise.py", line 29, in <module>
Notify: from markdown import markdown
Notify: File "/usr/lib/python2.7/site-packages/markdown/__init__.py", line 25, in <module>
Notify: from .core import Markdown, markdown, markdownFromFile
Notify: File "/usr/lib/python2.7/site-packages/markdown/core.py", line 29, in <module>
Notify: import pkg_resources
Notify: ImportError: No module named pkg_resources
Script Notify.py with command TestServers failed (terminated with unknown status)

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

Posted: 22 Sep 2019, 14:19
by l2g
Hi,

Your issue seems really similar to this one. You could try:

Code: Select all

pip install setuptools
What OS are you using?

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

Posted: 23 Sep 2019, 00:15
by chanster
l2g wrote:
22 Sep 2019, 14:19
Hi,

Your issue seems really similar to this one. You could try:

Code: Select all

pip install setuptools
What OS are you using?
I'm running Unraid and thanks for that link - it worked ! Followed the process to add the "custom-cont-init.d" directory etc. Thanks !