Last active
June 30, 2016 18:18
Get notified on Telegram when a user is transcoding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Written by pmow | |
# Upload to Gist by JonnyWong16 | |
# 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. | |
## Telegram notification basic script | |
### Based on Matriphe's at https://gist.github.com/matriphe/9a51169508f266d97313 | |
#script parameters: {video_decision} {user} {title} {player} {platform} | |
USERID="<numeric ID from @IDBot>" | |
KEY="<the API key from @BotFather>" | |
TIMEOUT="10" | |
URL="https://api.telegram.org/bot$KEY/sendMessage" | |
TEXT="$2 is playing $3 on device $4 ($5) $1" | |
#Something like: Username is playing Movie Name on device My Device (Android) Transcode | |
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 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment