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

Add Image Support to Telegram Notification

caronc opened this issue · comments

Ticket #36 is getting a bit long and within it was a request to allow for Image support in Telegram.
To break this out and make it easier to track, this is just a new ticket to represent the request.

Telegram Image support is as simple as adding ?image=Yes to the URL;

e.g: tgram:///123456789:abcdefg_hijklmnop/1234567/?image=Yes

Lemme know when its testable!

It should be there now 😄. Let me know how it goes.

alright! Here I go for a first spin.... result no picture seen in telegram so its not working for me yet. See logging beneath:

Notify: [DEBUG] Exiting with return code: 93
Notify: Sent Telegram notification.
Notify: [DEBUG] Telegram Payload: {'text': '<b>Download Successful</b>\r\n## Kill_Order_2017_BDRip_x264-JUSTWATCH ##\r\nStatus: SUCCESS/HEALTH\r\n\r\n### Statistics ###\r\n * Download Size: 508.00 MB\r\n * Download Time: 00:10:29\r\n * Transfer Speed: 827.01 KB/s \r\n * Analyse Time: 00:00:00\r\n * Repair Time: 00:00:00\r\n * Total Archive Preparation Time: 00:00:00\r\n * Unarchiving Time: 00:00:00\r\n * Total Post-Process Time: 00:00:42\r\n * Total Time: 00:11:11\r\n\r\n### File(s) ###\r\n * Kill.Order.2017.BDRip.x264-JustWatch.mkv (492.13 MB)\r\n * newz[NZB].nfo (13.00 B)', 'parse_mode': 'HTML', 'chat_id': <id>}
Notify: [DEBUG] Telegram POST URL: https://api.telegram.org/bot<id>:<id>/sendMessage (cert_verify=True)
Notify: [DEBUG] get(config) INCLUDEIMAGE="yes"
Notify: [DEBUG] get_files('/share/Download/nzbget/dst/Kill_Order_2017_BDRip_x264-JUSTWATCH') with 0 filter(s)
Notify: [DEBUG] get(system) NZBID="1475"
Notify: [DEBUG] get(system) CONTROLPASSWORD="tegbzn6789"
Notify: [DEBUG] get(system) CONTROLUSERNAME="nzbget"
Notify: [DEBUG] get(system) CONTROLPORT="6789"
Notify: [DEBUG] get(system) SECUREKEY=""
Notify: [DEBUG] get(system) SECURECERT=""
Notify: [DEBUG] get(system) SECURECONTROL="no"
Notify: [DEBUG] get(config) INCLUDELOGS="OnFailure"
Notify: [DEBUG] get(config) INCLUDEFILES="yes"
Notify: [DEBUG] get(config) INCLUDESTATS="yes"
Notify: [DEBUG] get(config) ONSUCCESS="yes"
Notify: [DEBUG] get(config) ONFAILURE="yes"
Notify: [DEBUG] get(config) SERVERS="tgram://<id>:<id>/<id>"
Notify: [DEBUG] get(config) INCLUDEIMAGE="yes"
Notify: [DEBUG] get(default) BODY=None
Notify: [DEBUG] get(default) TITLE=None
Notify: [DEBUG] Opened connection to SQLite Database: /share/Download/nzbget/tmp/nzbget/nzbget.db
Notify: [DEBUG] get(config) SERVERS="tgram://<id>:<id>/<id>"
Notify: [DEBUG] get(system) NZBID="1475"
Notify: NZBParse - NZB-File parsed 0 meta entries
Notify: NZB-File detected: Kill_Order_2017_BDRip_x264-JUSTWATCH.nzb.queued
Notify: [DEBUG] NZB-Files located: Kill_Order_2017_BDRip_x264-JUSTWATCH.nzb.queued (2018-03-03 15:25:10)
Notify: [DEBUG] Allowed Kill_Order_2017_BDRip_x264-JUSTWATCH.nzb.queued (regex)
Notify: [DEBUG] get_files('/share/Download/nzbget/nzb') with 1 filter(s)
Notify: [DEBUG] get(system) NZBDIR="/share/Download/nzbget/nzb"
Notify: [DEBUG] get_files('/share/MD0_DATA/Download/nzbget/tmp') with 1 filter(s)
Notify: [DEBUG] OS: Linux 3.4.6
Notify: [DEBUG] Python v2.7.13
Notify: [DEBUG] Script Mode: postprocess

Make sure to add ?image=true to your tgram:// url

Ah yes! I should've read better! It worked like a charm! awesome.

IMO both issue 36 and 40 can now be closed as solved! Thanks for the great work and patience :)

Keep up the great work!

Glad to hear everything is working for you!