I have some health problems and am looking to do some simple automation of my Roku as I'm "cutting the cord" for cost reasons. I have my Roku in developer mode, I have "keypress" over the network working, I understand the deep linking "launch" URL syntax, but I'm having trouble finding information about how to find the contendID and MediaType of the currently playing video. These 2 variables would come from commercial channels that would be launched off the home screen. I'm not trying to develop my own channel (and can't right now because of the mentioned health issues). Getting the appID is easy enough from "query/apps", but most of my live TV channels don't go directly into playing the channel video. I could automate this with a "launch" and many blind "keypress" calls, but that's kind of a kludge. Deep linking seems much more elegant if it can work. And yes, I understand that contentID and MediaType are chosen by the channel developers and maintainers and may change without notice (as could the user interface that "keypress" would interact with).
So, is there an easy way I can run a "query" to a currently playing video and get this information?
This is a grossly over simplified shell script I'm thinking about running in the morning:
#/bin/bash
#Simple automated day example.
#Note that numbers given are examples and code is incomplete.
IP="192.168.1.220"
WaitUntilTime() {
#calling date and sleep for a primitive scheduler.
}
#paranoia: make sure roku starts from a known state.
curl -d '' "http://${IP}:8060/keypress/home"
sleep 5s
#start morning music channel.
curl -d '' "http://${IP}:8060/launch/10001
#start morning local news.
WaitUntilTime 7am
curl -d '' "http://${IP}:8060/launch/10002?contentID=13234&MediaType=live"
#start morning financial news.
WaitUntilTime 8am
curl -d '' "http://${IP}:8060/launch/10003?contentID=13234&MediaType=live"
#start lunchtime local news.
WaitUntilTime 12pm
curl -d '' "http://${IP}:8060/launch/10002?contentID=13234&MediaType=live"
#start afternoon financial news.
WaitUntilTime 1pm
curl -d '' "http://${IP}:8060/launch/10003?contentID=13234&MediaType=live"
#end of financial day, go into standby.
WaitUntilTime 3pm
curl -d '' "http://${IP}:8060/keypress/home"
#time to cook dinner, play a music channel
WaitUntilTime 5:30pm
curl -d '' "http://${IP}:8060/launch/10005?contentID=13234&MediaType=live"
#start dinnertime local news.
WaitUntilTime 6pm
curl -d '' "http://${IP}:8060/launch/10002?contentID=13234&MediaType=live"
### ...and so on...
Thanks for the help.
Maybe I should rephrase: Why aren't contentID and mediaType included in "query/media-player"??? This would seem like a logical place to put them.
http://192.168.1.220:8060/query/media-player
only shows the following:
<player state="play" error="false">
<plugin id="151908" name="The Roku Channel" bandwidth="3271973 bps" />
<format audio="aac_adts" video="mpeg4_10b" captions="608_708" drm="none" container="hls" />
<buffering target="0" max="1000" current="1000" />
<new_stream speed="128000 bps" />
<position>187835 ms</position>
<duration>220000 ms</duration>
<is_live blocked="false">true</is_live>
<stream_segment media_sequence="228854" time="180000" bitrate="3401200" segment_type="mux" width="0" height="0" />
</player>
Asking the same question. My requirement is the same. I need content ID.