[mythtv-users] Checking status via API

Bill Meek keemllib at gmail.com
Sun Mar 5 22:18:04 UTC 2017


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


More information about the mythtv-users mailing list