Why would an Android TV device respond to a toggle_record POST with a "not found", even though it is tuned to a channel via the API and can be stopped via the API as well?
Does it appear as an option in the api help output?
What is the "api help output"? I don't see that documented.
Curl /api shows it
Welcome to the Channels API
With this API, you can query Channels' status as well as control it.
## Info
Check out the current status of the player or fetch the favorite channels.
GET /api/status - Player's current status
GET /api/favorite_channels - List of favorite channels
## Controls
Control the playback of Channels. All control responses return the player's current status.
POST /api/toggle_mute - Toggle mute on and off
POST /api/toggle_cc - Toggle captions on and off
POST /api/toggle_pip - Toggle Picture in Picture on and off
POST /api/channel_up - Change the channel
POST /api/channel_down - Change the channel
POST /api/previous_channel - Jump to the previous channel
POST /api/toggle_pause - Pause or resume playback based on current playing state
POST /api/pause - Pause playback
POST /api/resume - Resume playback
POST /api/stop - Stop playback
POST /api/seek/{seconds} - Seek in timeline by seconds
POST /api/seek_forward - Seek ahead duration in settings
POST /api/seek_backward - Seek back duration in settings
POST /api/skip_forward - Skip to the next chapter mark
POST /api/skip_backward - Skip to the previous chapter mark
POST /api/play/channel/{channel_number} - Play a channel
POST /api/play/recording/{recording_id} - Play a recording
POST /api/navigate/{section_name} - Change to a section of the app by providing its name. EX, Guide, Library, Live TV
POST /api/notify - Present a notification while playing video - example payload: {"title":"Arrived home", "message":"Jon has arrived home"}
So, no toggle_record? Is this a version issue?, platform issue? has toggle_record been removed from the API?
Okay it wasn't added to android then. I'll take a look today.
Try this build:
Updated to the most recent Beta and now a toggle_record returns : "BAD REQUEST: Syntax error. HTTP verb Post unhandled"
But, this is possibly because I can't start a recording now play/channel/# returns a "status:stopped"
Can you try again with the latest beta
Now all requests get a "curl: (7) Failed to connect to 192.168.183.158 port 57000: Connection refused" response. I've checked the url and it is correct. This brings up a question. I noticed that I had the beta program and the regular program both running the last time I tested (this last time, I uninstalled the play store version and ran only the beta). How would these two programs, both attempting to use port 57000 resolve the conflict?
You probably need to restart the beta then because it would have failed to grab the port while the stable was using it
Ok, getting closer. Now, I can get a status with a complete listing of api options. "play/channel/#" works, but there doesn't seem to be a way to stop the program from playing. Also, "toggle_record" works to start a recording, but does not toggle the recording off. Other than /status, I haven't tested other options yet.
/api/stop is supposed to stop the player
Toggling record off shows a confirmation dialog on screen.
I noticed there were some recent API changes and just discovered this thread
This morning i noticed that the HTTP API on my system is hosed.
I had set up a bunch of ios shortcuts accessing the channels http api about a year ago. They have been working flawlessly.
For some reason this morning im getting a “could not connect to the server” no matter what i do, including using a browser, curl, etc
Has the syntax changed, port number, etc.?
Ive tried loading the latest stable build on the server
9.11.0707
I also reinstalled channels from scratch and went back to the stable build with the install but ran into the same issue.
so for now Im back on 9.11.0707 and using the latest test flight beta
Ive also rebooted my server, router, apple tv, etc.
Any help would be appreciated..
I also tried using curl get status and got connection refused? channels dvr app was open on apple tv...
The /api/status
endpoint uses the GET
verb. Since that is the default, remove the -X POST
from your command.
For the endpoints and their respective verbs, see the API listing.
thanks for suggestion. i already noticed that and retried using a couple of commands while the apple tv app is open. still getting connection refused using curl and “could not connect to the server” using known previously working iOS shortcuts. never had to use curl before, just trying to get more info for debugging this issue
Can you force stop and restart the android app
Im using TVOS.
Force restart was one of the first things i tried this morning with no success.
I just did another force restart and shortcuts working again!
Curl commands as well.
Something Very Strange going on here…
But im very happy all my shortcuts work with the API again.
Ill poke you if i see this strange behavior again, and of course let me know if you need my assistance if anyone else starts seeing the API interface getting hosed…
I'd like to see an indicator added to the API that would show when detected-commercials are playing. My ultimate end game here is to use this with Home Assistant automations. If I just have a TV playing in the house "ambiently" then I don't mind if commercials play (and/or if I'm slightly behind a live recording, for example) -- but what I would like to be able to do is have home assistant reduce or mute the volume on the TV during the commercial breaks.
You could use a script in HA to:
- get the info for the currently playing file, which includes at which points the commercials were detected
- poll the server for the current time into the recording
- if the current time is within a commercial block, then adjust the volume down
There are other ways to automate this, but an intrepid user familiar with HA automations and scripts should have no problem making this work with existing tools.
Of course, this is for items already in the library. As has been stated time and again, actual live detection is not really up to snuff.