Last active
September 1, 2022 15:08
-
-
Save rpcameron/3b0f51eae3df36948edbc02a03870b69 to your computer and use it in GitHub Desktop.
Manual Channels recording
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 | |
# This is using GNU date; will not work on macOS/BSD | |
_DVR=${CHANNELS:-127.0.0.1} | |
if [ -z $3]; then | |
echo "Usage: $0 channel start duration [title [description]]" | |
exit 0 | |
fi | |
_CH=$1 | |
_START=$(date -d "$2" +%s) | |
_DUR=$(("$3" * 60)) | |
_TITLE=${4:-"Manual Recording"} | |
_DESC=$5 | |
create_job() { | |
cat << EOF | |
{ | |
"Name": "${_TITLE}", | |
"Time": ${_START}, | |
"Duration": ${_DUR}, | |
"Channels": ["${_CH}"], | |
"Airing": { | |
"Source": "manual", | |
"Channel": "${_CH}", | |
"Time": ${_START}, | |
"Duration": ${_DUR}, | |
"Title": "${_TITLE}", | |
"Summary": "${_DESC}", | |
"Image": "https://tmsimg.fancybits.co/assets/p9467679_st_h6_aa.jpg", | |
"SeriesID": "manual/${_CH}", | |
"ProgramID": "manual/${_TITLE}" | |
} | |
} | |
EOF | |
} | |
curl -XPOST --data-binary "$(create_job)" "http://${_DVR}:8089/dvr/jobs/new" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment