brianspilner01 / media-server-scripts

84 stars 18 forks source link

Discord Webhook Notification #12

Closed jpoll closed 3 years ago

jpoll commented 3 years ago

Would it be possible to incorporate a Discord webhook notification to notify a channel that a subtitle was processed and lines were removed?

brianspilner01 commented 3 years ago

I think notifications might be beyond the scope of the script a little bit and adding support for x amount of notification services would over-complicate it. It's definitely something I'd encourage you to add for yourself however, and I'd be happy to give you a hand with the code for it, it should be as simple as adding one line at about the same time as it echos to stdout. Something like:

curl "$DISCORD_WEBHOOK_URL" -F username=sub-clean -F content="sub-clean.sh succesfully processed $SUB_FILEPATH"$'\n'"The following lines were removed:"$'\n'"$REMOVED_LINES"