diff --git a/External-Scripts-(experimental).md b/External-Scripts-(experimental).md index 93d4861..88e2bfe 100644 --- a/External-Scripts-(experimental).md +++ b/External-Scripts-(experimental).md @@ -1,12 +1,17 @@ -## Telegram notification basic script -### From https://gist.github.com/matriphe/9a51169508f266d97313 +To enable scripts, set a Script Folder at Settings > Notification Agents > Scripts. Place any script files in this directory with appropriate permissions (executable and accessible to the PlexPy user). + +For this video transcode alert script, you should select the script for action types where it would be useful: Playback Start and Playback Resume, for example. Under Settings > Notifications > Scripts, set the parameters that should get passed to the script. + + #!/bin/sh - # Just alerts on {video_decision} as first parameter, must be specified in script settings. + ## Telegram notification basic script + ### Based on Matriphe's at https://gist.github.com/matriphe/9a51169508f266d97313 + #script parameters: {video_decision} {user} {title} {player} {platform} USERID="" KEY="" TIMEOUT="10" URL="https://api.telegram.org/bot$KEY/sendMessage" - TEXT="Crap, your server is transcoding something: ! Go check on it, noob!" + TEXT="$2 is playing $3 on device $4 ($5) $1" if [ "$1" != "Direct Play" ] && [ "$1" != "Copy" ]; then curl -s --max-time $TIMEOUT -d "chat_id=$USERID&disable_web_page_preview=1&text=$TEXT" $URL > /dev/null