Code: Select all
WARNING Notify: Failed to send Telegram:1234567890 notification: (400) Bad Request: Can't parse message text: Can't find end of the entity starting at byte offset 4094.
Well you definitely uncovered a bug with the new Telegram support I recently added. Telegram uses a markdown langugage to add bold/italic to things it posts. but it would appear it can't handle these special characters if they don't already have a match; For example:
_i am bold between underscores_
would get translated to: i am bold between underscores
But filenames that have underscores in them already can conflict with this logic... for example: _A_Filename_with_underscores_
) might get translated to AFilenamewithunderscores
(spaces are lost because they're reserved for bolding). Alternatively, when a line/word can't be parsed, it usually just doesn't do anything and leaves everything how it was (underscores included - this is how GitHub does it).
Anyway, usually it's not a big deal, but clearly Telegram isn't having any of it. Based on your logs, an odd number of markdown tokens appears to causes Telegram to backfire. But it's giving you the character location the backfire is occurring at.
Sooo... I'm going to need some time to fix this bug. I'll have to write a new chunk of code that escapes the markup language for 'just' Telegram messages since it appears to be the only one that has this problem. What you'll find is some messages might go through and others won't. It'll be completely dependant on the content of the notification.
It would be a fantastic help if you could turn Debugging mode on your Notify Script (through NZBGet's options) and private message me the Payload that triggers your error. The log entry "Telegram Payload: ....
" is specific what I'm interested in. I'd also like the Telegram error that shows you the character # that caused it to be rejected.
: I just thought of a quick and dirty fix that may work (content pushed). Can you fetch the master content and try again when you have a chance? I'll still be interested in the payload if it fails though (as per discussion above).