Project

General

Profile

RE: tvheadend api api/dvr/entry/create ยป simpletimer.sh

paul griffiths, 2021-10-21 11:11

 
1
#!/bin/bash
2

    
3
tvheadend=192.168.1.30
4

    
5
profile_name="usb"
6
config_name=$(curl -sS --digest -d 'filter=[{"type":"string","value":"'"$profile_name"'","field":"name"}]' \
7
    http://$tvheadend:9981/api/dvr/config/grid | \
8
    jq '.entries[0] .uuid' | \
9
    xargs
10
)
11

    
12

    
13

    
14
startT=$(date -d 'today 21:00:00' '+%s')
15
endT=$(date -d 'today 21:30:00' '+%s')
16
channelname="BBC One"
17

    
18
curl --data 'conf={"config_name":"'"$config_name"'", \
19
                   "start":"'"$startT"'", "stop":"'"$endT"'", \
20
                   "channelname":"'"$channelname"'", \
21
                   "title":{"eng":"My programme title"}, "subtitle":{"eng":"My subtitle"} }' \
22
                   http://$tvheadend:9981/api/dvr/entry/create
    (1-1/1)