From e5eb5be9d8cbd6c7b7ad3598f6047705a257b456 Mon Sep 17 00:00:00 2001 From: randomuser345 Date: Sat, 10 Sep 2022 13:04:26 +0200 Subject: [PATCH] Update webhook to be compatible with discord --- README.md | 2 +- root/scripts/audio.sh | 5 +++-- root/scripts/video.sh | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index dbc160e..23d3aa7 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ Container images are configured using parameters passed at runtime (such as thos | `-e plexUrl=http://x.x.x.x:32400` | ONLY used if PlexNotify.bash is used...| | `-e plexToken=` | ONLY used if PlexNotify.bash is used... | | `-e youtubeSubtitleLanguage=en` | Desired Language Code :: For guidence, please see yt-dlp documentation. -| `-e webHook=https://myhook.mydomain.com` | POST's to this URL on error events which prevent the script from working. Content is JSON `{"event":"eventtype", "message":"eventmessage"}` | +| `-e webHook=https://myhook.mydomain.com` | POST's to this URL on error events which prevent the script from working. Content is JSON `{"event":"eventtype", "message":"eventmessage", "content":"eventtype: eventmessage"}` | | `-e enableQueueCleaner=true` | true = enabled :: Enables QueueCleaner Script that automatically removes stuck downloads that cannot be automatically imported on a 15 minute interval | ## Usage diff --git a/root/scripts/audio.sh b/root/scripts/audio.sh index 9d28316..df0ca99 100644 --- a/root/scripts/audio.sh +++ b/root/scripts/audio.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.245" +scriptVersion="1.0.246" if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" if [ "$lidarrUrlBase" = "null" ]; then @@ -1909,7 +1909,8 @@ audioFlacVerification () { NotifyWebhook () { if [ "$webHook" ] then - curl -X POST "{$webHook}" -H 'Content-Type: application/json' -d '{"event":"'"$1"'", "message":"'"$2"'"}' + content="$1: $2" + curl -X POST "{$webHook}" -H 'Content-Type: application/json' -d '{"event":"'"$1"'", "message":"'"$2"'", "content":"'"$content"'"}' fi } diff --git a/root/scripts/video.sh b/root/scripts/video.sh index 230f60c..a2e66c5 100644 --- a/root/scripts/video.sh +++ b/root/scripts/video.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.039" +scriptVersion="1.0.040" if [ -z "$lidarrUrl" ] || [ -z "$lidarrApiKey" ]; then lidarrUrlBase="$(cat /config/config.xml | xq | jq -r .Config.UrlBase)" @@ -563,7 +563,8 @@ AddFeaturedVideoArtists () { NotifyWebhook () { if [ "$webHook" ] then - curl -X POST "{$webHook}" -H 'Content-Type: application/json' -d '{"event":"'"$1"'", "message":"'"$2"'"}' + content="$1: $2" + curl -X POST "{$webHook}" -H 'Content-Type: application/json' -d '{"event":"'"$1"'", "message":"'"$2"'", "content":"'"$content"'"}' fi }