[mythtv-users] Checking status via API

Marc Rawji mrawji at gmail.com
Mon Mar 6 05:21:19 UTC 2017


On Sun, Mar 5, 2017 at 2:18 PM, Bill Meek <keemllib at gmail.com> wrote:

> On 03/05/2017 03:39 PM, Marc Rawji wrote:
>
>> One last try... Does anyone know how to check (programatically)  if a
>> client (like Kodi) is streaming content via the API?
>>
>> Thanks,
>> Marc
>>
>> On Sun, Feb 26, 2017 at 9:41 PM, Marc Rawji <mrawji at gmail.com> wrote:
>>
>>
>>> On Sun, Feb 5, 2017 at 4:56 AM, Daniel Frey <dmfrey at gmail.com> wrote:
>>>
>>> you can do a HTTP GET to /Dvr/GetEncoderList. There is a Program object
>>>> that indicates what the input is currently doing. You can determine from
>>>> the as well if it is recording or watching live TV.
>>>>
>>>> On Sat, Feb 4, 2017, 11:59 PM Marc Rawji <mrawji at gmail.com> wrote:
>>>>
>>>> Hi Everyone,
>>>>>
>>>>> I am running a combined mythbackend / mythfrontend in my living room...
>>>>> I have a couple of Kodi clients on other hosts (like tablets). If I
>>>>> understand correctly, Kodi uses the API to gain access to the
>>>>> recordings.
>>>>>
>>>>> Is there a way that I can query the API to find out if there are any
>>>>> clients currently watching content via the API?
>>>>>
>>>>> Thanks,
>>>>> Marc
>>>>>
>>>>>
>>>>>
>>>> Thanks Daniel... I just tried that and the response from that API is the
>>> same whether or not a client is playing something... am I using it wrong?
>>>
>>> I am calling it like this:
>>> curl http://localhost:6544/Dvr/GetEncoderList | xmllint --format -
>>>
>>>
> If by clients you mean the frontend, then the following, but if you're
> referring to something else that's doing Content/GetFile?FileName=xxx,
> then I don't know of an answer.
>
> Dvr/Frontend/GetStatus (on port 6547)
>
> An idle frontend returns:
>
> {
>     "FrontendStatus": {
>         "AudioTracks": {},
>         "ChapterTimes": [],
>         "Name": "ofc0",
>         "State": {
>             "currentlocation": "playbackbox",
>             "menutheme": "defaultmenu",
>             "state": "idle"
>         },
>         "SubtitleTracks": {},
>         "Version": "v29-pre-307-g0a46103-dirty"
>     }
> }
>
> If actively viewing, there are some 50ish lines of output
> and, of course, the state: changes to WatchingLiveTV.
>
> --
> Bill
>
>
Thanks Bill. Yeah, it's not a Frontend, so no Frontend API to query. I have
multiple tablets with Kodi on them that I am using to view my recordings. I
have a script that turns off my backend if it's idle. I am looking for a
way to detect when my backend is sending content to one of my tablets to
keep it from shutting down.

Thanks,
Marc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20170305/bf735b82/attachment.html>


More information about the mythtv-users mailing list