Channels HTTP API

Unfortunately there's no tvOS API to launch apps.

I didn't think there was, but thought I'd ask around. I hope Apple gets around adding that functionality to tvOS, but not gonna hold my breath.

Thanks!

1 Like

Yeah it stinks. They’ll probably never add anything like that either. Their security model pretty much prevents things like this.

I use an automation for my kitchen tv every morning to play the news while I make coffee. I just make sure whenever I stop watching anything on the kitchen tv, that Channels is opened and ready for my automation. ¯(°_O)/¯

1 Like

Would there be any possibility of adding an API call to play the oldest/newest recording from a given series pass? (My use case would be, essentially, a HomeAssistant command to "play Jeopardy" and have Channels pull up the oldest unwatched recording in the Jeopardy series pass; I don't see a way to really index into the recordings programatically right now?)

1 Like

We probably wouldn’t add that directly to the Channels API on the client apps.

But you can directly play a recording with the API, you just need to figure out the ID of that recording, heh.

The Channels DVR api isn’t public, but it IS there. You can use it to figure out the right episode and then call the Channels API to play that recording. I do something like what you’re wanting to do.

You can get all the recordings of a series with this endpoint:

http://$HOST:8089/dvr/groups/$SERIES_ID/files

One question comes to my mind. Could it be possible to add to API endpoint that could show what is the next or next two jobs planned for recording a show AND webhook for listening when particular recording is finished?
Therefore I could automate whole process and starting VPN connection before recording certain things.
I'm sure lot of people would benefit :slight_smile:

1 Like

Anything is possible with software! :wink:

Webhooks are in the plan, but we're not sure when we'll get to them. I really want them so we can empower you guys to build such things.

You can get a list of jobs now by hitting: /dvr/jobs

This is the unstable API that the apps use. It's not official, stable, or supported. But it's there for you to use if you want.

2 Likes

Thank you! Just follow-up question - where is Channels database located? I would like to interact with it directly because if I transcode mpg files to h.264 or hevc it better to change extension and therefore full filepath in database should also change

The database isn’t accessible.

Not good. Understandable from security point of view but it make putting re-encoded files in db impossible

You can re-encode files and leave the extension the same. A mpg container can contain any codec. However if you change change codecs it may not play in Channels app anymore.

MKV’s play fine with a mpg extension (with H264... haven't tried HEVC) :upside_down_face:

You may run into issues now or in the future with transcoding. The transcoder assumes the file is MPEG-TS and you may run into strange behavior with other container types.

Handily, TS containers can happily accept H.264/AVC and H.265/HEVC video codecs, as well as MP3, AAC, AC-3/A-52/Dolby and DTS audio codecs.

Exactly, so as long as you stick with MPEG-TS instead of MKV as the container format you should be in good shape (if our player and transcoder can understand the codec).

I want to setup some monitoring on my Channels DVR server. Any chance we will be able to access that API at some point?

For example how many local and how many remote streams are currently in use. Current software version etc...

1 Like

What are the Siri Shortcuts? I do not seem them in the shortcuts app as a useable app. Am I missing something?

The Channels app does not actually offer Shortcuts. Instead we offer some on our site that employ the API that the TV based Channels versions have running in the background.

You can find them here: https://getchannels.com/api/#siri-shortcuts

1 Like

Ahh I see. Never knew about this. AWESOME! Thank you.

1 Like

Here's something that's even BETTER in iOS 13. You can have shortcuts OPEN apps on your specified Apple TV in a Shortcut.

So if you edit the shortcuts from our site, add an action to do this before it tells the Channels app to start a channel. It'd be worth adding a delay of about 1-2 seconds to let the app boot before telling it what channel to change to.

Now, the Shorcuts can work even when the app isn't open!

2 Likes