Add Telegram & Ntfy templates with special instructions

This commit is contained in:
Fallenbagel 2022-08-29 18:13:22 +05:00
parent 571d1a89ab
commit d6decbcc19
3 changed files with 98 additions and 0 deletions

View File

@ -0,0 +1,47 @@
{
"topic": "jellyfin",
"tags": ["octopus"],
{{#if_equals NotificationType 'PlaybackStart'}}
"title": "{{{NotificationUsername}}} Playback Started",
"priority": 3,
"attach": "{{{ServerUrl}}}/Items/{{{ItemId}}}/Images/Primary",
{{#if_equals ItemType 'Episode'}}
"message": "{{{NotificationUsername}}} stopped playing:\n\n{{{SeriesName}}} ({{Year}})\nS{{SeasonNumber00}}E{{EpisodeNumber00}} - {{{Name}}}\n{{Overview}}\n\non {{{ServerName}}}",
{{else}}
"message": "{{{NotificationUsername}}} stopped playing:\n\n{{{Name}}} ({{Year}})\n{{Overview}}\n\non {{{ServerName}}}",
{{/if_equals}}
{{/if_equals}}
{{#if_equals NotificationType 'PlaybackStop'}}
"title": "{{{NotificationUsername}}} Playback Stopped",
"priority": 3,
"attach": "{{{ServerUrl}}}/Items/{{{ItemId}}}/Images/Primary",
{{#if_equals ItemType 'Episode'}}
"message": "{{{NotificationUsername}}} stopped playing:\n\n{{{SeriesName}}} ({{Year}})\nS{{SeasonNumber00}}E{{EpisodeNumber00}} - {{{Name}}}\n{{Overview}}\n\non {{{ServerName}}}",
{{else}}
"message": "{{{NotificationUsername}}} stopped playing:\n\n{{{Name}}} ({{Year}})\n{{Overview}}\n\non {{{ServerName}}}",
{{/if_equals}}
{{/if_equals}}
{{#if_equals NotificationType 'ItemAdded'}}
"priority": 3,
"attach": "{{{ServerUrl}}}/Items/{{{ItemId}}}/Images/Primary",
{{#if_equals ItemType 'Movie'}}
"title": "Movie Added",
"message": "{{ItemType}} Now Available\n\n{{{Name}}} ({{Year}})\n{{Overview}}\n\nRuntime\n{{RunTime}}\n\nStatus\nAvailable"
{{/if_equals}}
{{#if_equals ItemType 'Season'}}
"title": "Season Added",
"message": "{{ItemType}} Now Available\n\n{{{SeriesName}}} ({{Year}})\n{{{Name}}}\n{{Overview}}\n\nRuntime\n{{RunTime}}\n\nStatus\nAvailable"
{{else}}
"title": "Episode Added",
"message": "Episode Now Available\n\n{{{SeriesName}}} ({{Year}})\nS{{SeasonNumber00}}E{{EpisodeNumber00}} - {{{Name}}}\n{{Overview}}\n\nRuntime\n{{RunTime}}\n\nStatus\nAvailable"
{{/if_equals}}
{{/if_equals}}
{{#if_equals NotificationType 'PendingRestart'}}
"title": "Jellyfin Restart Required",
"priority": 4,
"message": "Jellyfin needs to be restarted, please restart jellyfin as soon as possible!"
{{/if_equals}}
}

View File

@ -0,0 +1,37 @@
##Templates
####Telegram
Webhook URL:
```
https://api.telegram.org/bot<id>:<token>/sendPhoto
```
To get the chatid:
- start a chat with your bot
- add `@get_id_bot`
- issue the `/my_id` command
After adding the template add a request header as follows:
```
Key:
Content-Type
Value:
application/json
```
####Ntfy
Webhook URL:
```
https://ntf.sh
#or
https://yourntfyurl.tld
```
If your ntfy needs authorization headers then add a request header as follows:
```
Key:
Authorization
Value:
Basic <base64encodedpassword>
```

View File

@ -0,0 +1,14 @@
{"chat_id":"{{chatid}}",
"photo":"{{ServerUrl}}/Items/{{ItemId}}/Images/Primary",
{{#if_equals ItemType 'Season'}}
"caption": "<b>{{ItemType}} Now Available</b>\n\n<b>{{{SeriesName}}} ({{Year}})</b>\n<b><em>{{{Name}}}</em></b>\n{{Overview}}\n\n<b>Runtime</b>\n{{RunTime}}\n\n<b>Status</b>\nAvailable"
{{else}}
{{#if_equals ItemType 'Episode'}}
"caption": "<b>Episode Now Available</b>\n\n<b>{{{SeriesName}}} ({{Year}})</b>\n<b>S{{SeasonNumber00}}E{{EpisodeNumber00}}</b> - <b><em>{{{Name}}}</em></b>\n{{Overview}}\n\n<b>Runtime</b>\n{{RunTime}}\n\n<b>Status</b>\nAvailable"
{{else}}
"caption": "<b>{{ItemType}} Now Available</b>\n\n<b>{{{Name}}} ({{Year}})</b>\n{{Overview}}\n\n<b>Runtime</b>\n{{RunTime}}\n\n<b>Status</b>\nAvailable"
{{/if_equals}}
{{/if_equals}},
"parse_mode": "html",
"disable_notification":"true","protect_content":"true"
}