[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.
Posts: 8
Joined: 26 Apr 2016, 07:57

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

Post by b0mb » 12 Feb 2019, 20:43

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 ;)

Posts: 214
Joined: 27 Jun 2014, 22:13

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

Post by l2g » 16 Feb 2019, 06:23

@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.

Posts: 214
Joined: 27 Jun 2014, 22:13

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

Post by l2g » 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
@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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest