jellyfin / jellyfin-plugin-webhook

GNU General Public License v3.0
148 stars 47 forks source link

Discord notifications not working #123

Closed Alarisco closed 2 years ago

Alarisco commented 2 years ago

Discord notfification not working for me

Versión: 10.8.0 in docker container

[2022-06-23 16:23:20.172 +02:00] [DBG] [3] Jellyfin.Plugin.Webhook.Notifiers.ItemAddedNotifier.ItemAddedManager: ProcessItemsAsync
[2022-06-23 16:23:20.172 +02:00] [DBG] [3] Jellyfin.Plugin.Webhook.Notifiers.ItemAddedNotifier.ItemAddedManager: Item "A Olivia"
[2022-06-23 16:23:20.172 +02:00] [DBG] [3] Jellyfin.Plugin.Webhook.Notifiers.ItemAddedNotifier.ItemAddedManager: Notifying for "A Olivia"
[2022-06-23 16:23:20.249 +02:00] [DBG] [3] Jellyfin.Plugin.Webhook.Destinations.Discord.DiscordClient: SendAsync Body: "{
    \"content\": \"\",
    \"avatar_url\": \"\",
    \"username\": \"JellyNoty\",
    \"embeds\": [
        {
            \"color\": \"697804\",
            \"footer\": {
                \"text\": \"From ce3b26fb9873\",
                \"icon_url\": \"\"
            },
                    \"title\": \"A Olivia (2022) ha sido añadido a ce3b26fb9873\",
            \"thumbnail\":{
                \"url\": \"alariscomedia.duckdns.org:8096/Items/d1b1bce6-46a8-bf63-bd9c-4e4886ac70ef/Images/Primary\"
            },
            \"description\": \"External Links:\n[IMDb](https://www.imdb.com/title/tt7598106/)\n[TMDb](https://www.themoviedb.org/movie/656584)\n[Jellyfin](alariscomedia.duckdns.org:8096/web/index.html#!/details?id=d1b1bce6-46a8-bf63-bd9c-4e4886ac70ef&serverId=ade19691034f4880b824c07c139f484b)\"
        }
    ]
}"
[2022-06-23 16:23:20.453 +02:00] [WRN] [23] Jellyfin.Plugin.Webhook.Destinations.Discord.DiscordClient: Notification failed with "POST" request to https://discord.com/api/webhooks/989501972199653398/kYywItWtz9G4xFjP2S_Che9R3Cm75WVw4A_K45t3EjLiVflcKiOvqbCPaPhj39psiD9f: "{
    \"content\": \"\",
    \"avatar_url\": \"\",
    \"username\": \"JellyNoty\",
    \"embeds\": [
        {
            \"color\": \"697804\",
            \"footer\": {
                \"text\": \"From ce3b26fb9873\",
                \"icon_url\": \"\"
            },
                    \"title\": \"A Olivia (2022) ha sido añadido a ce3b26fb9873\",
            \"thumbnail\":{
                \"url\": \"alariscomedia.duckdns.org:8096/Items/d1b1bce6-46a8-bf63-bd9c-4e4886ac70ef/Images/Primary\"
            },
            \"description\": \"External Links:\n[IMDb](https://www.imdb.com/title/tt7598106/)\n[TMDb](https://www.themoviedb.org/movie/656584)\n[Jellyfin](alariscomedia.duckdns.org:8096/web/index.html#!/details?id=d1b1bce6-46a8-bf63-bd9c-4e4886ac70ef&serverId=ade19691034f4880b824c07c139f484b)\"
        }
    ]
}"
[2022-06-23 16:23:20.453 +02:00] [WRN] [23] Jellyfin.Plugin.Webhook.Destinations.Discord.DiscordClient: Notification failed with response status code BadRequest: "{\"embeds\": [\"0\"]}"

Template:

{
    "content": "{{MentionType}}",
    "avatar_url": "{{AvatarUrl}}",
    "username": "{{{BotUsername}}}",
    "embeds": [
        {
            "color": "{{EmbedColor}}",
            "footer": {
                "text": "From {{{ServerName}}}",
                "icon_url": "{{AvatarUrl}}"
            },
            {{#if_equals ItemType 'Season'}}
                "title": "{{{SeriesName}}} {{{Name}}} ha sido añadido a {{{ServerName}}}",
            {{else}}
                {{#if_equals ItemType 'Episode'}}
                    "title": "{{{SeriesName}}} S{{SeasonNumber00}}E{{EpisodeNumber00}} {{{Name}}} ha sido añadido a {{{ServerName}}}",
                {{else}}
                    "title": "{{{Name}}} ({{Year}}) ha sido añadido a {{{ServerName}}}",
                {{/if_equals}}
            {{/if_equals}}
            "thumbnail":{
                "url": "{{ServerUrl}}/Items/{{ItemId}}/Images/Primary"
            },
            "description": "External Links:\n
            {{~#if_exist Provider_imdb~}}
            [IMDb](https://www.imdb.com/title/{{Provider_imdb}}/)\n
            {{~/if_exist~}}
            {{~#if_exist Provider_tmdb~}}
                {{~#if_equals ItemType 'Movie'~}}
                    [TMDb](https://www.themoviedb.org/movie/{{Provider_tmdb}})\n
                {{~else~}}
                    [TMDb](https://www.themoviedb.org/tv/{{Provider_tmdb}})\n
                {{~/if_equals~}}
            {{~/if_exist~}}
            {{~#if_exist Provider_musicbrainzartist~}}
                [MusicBrainz](https://musicbrainz.org/artist/{{Provider_musicbrainzartist}})\n
            {{~/if_exist~}}
            {{~#if_exist Provider_audiodbartist~}}
                [AudioDb](https://theaudiodb.com/artist/{{Provider_audiodbartist}})\n
            {{~/if_exist~}}
            {{~#if_exist Provider_musicbrainztrack~}}
                [MusicBrainz Track](https://musicbrainz.org/track/{{Provider_musicbrainztrack}})\n
            {{~/if_exist~}}
            {{~#if_exist Provider_musicbrainzalbum~}}
                [MusicBrainz Album](https://musicbrainz.org/release/{{Provider_musicbrainzalbum}})\n
            {{~/if_exist~}}
            {{~#if_exist Provider_theaudiodbalbum~}}
                [TADb Album](https://theaudiodb.com/album/{{Provider_theaudiodbalbum}})\n
            {{~/if_exist~}}
            {{~#if_exist Provider_tvmaze~}}
                {{~#if_equals ItemType 'Episode'~}}
                    [TVMaze](https://www.tvmaze.com/episodes/{{Provider_tvmaze}})\n    
                {{~/if_equals~}}
                {{~#if_equals ItemType 'Series'~}}
                    [TVMaze](https://www.tvmaze.com/shows/{{Provider_tvmaze}})\n
                {{~/if_equals~}}                
            {{~/if_exist~}}
            [Jellyfin]({{ServerUrl}}/web/index.html#!/details?id={{ItemId}}&serverId={{ServerId}})"
        }
    ]
}
BritishBenji commented 2 years ago

Was there ever a fix for this? Receiving the same error

crobibero commented 2 years ago

The fix is that you need to specify the protocal under server url.

BritishBenji commented 2 years ago

Ah, I'd missed out the protocol on mine, that's what caused it 😅 Thanks!