v18 How to get the current played title of a Radio stream?
#1
If I play this radio-stream http://stream.srg-ssr.ch/drs3/aacp_96.m3u Kodi is able to show the current Played title. How could I get this data via JSON-RPC?

I tried following but I'm not able to get the title.
json:
return {
    payload:
            {"jsonrpc": "2.0",
            "method": "Player.GetItem",
            "params": {
            "playerid": msg.payload,
            "properties": [
                "title",
                "originaltitle",
                "description",
                "fanart",
                "thumbnail",
                "albumlabel",
                "album",
                "showtitle"
                ],
            },
            "id": 2
            }
};
Reply
#2
I think those values come from the music db so they are not valid for an internet stream.  Probably you need to use XBMC.GetInfoLabels as your JSON call and get the ListItem.Title and ListItem.Artist for the currently playing item.
Learning Linux the hard way !!
Reply
#3
I tried many things. I was not able to use it in a JSON Request. Do you have a hint how I could use it?
Reply
#4
Sure.  This
json:
{
            "id": 1,
            "name": "getlabels",
            "method": "get",
            "query": {"jsonrpc":"2.0","id":1,"method":"XBMC.GetInfoLabels","params": {"labels":["player.title"]}}
        }
returns
json:
{
      "id": 1,
      "name": "getlabels",
      "status_code": 200,
      "result": {
        "id": 1,
        "jsonrpc": "2.0",
        "result": {
          "player.title": "Talk Talk - It's My Life"
        }
      }
    }

for the live radio stream I am currently listening to.  You might also be able to use MusicPlayer.Title and MusicPlayer.Artist depending on whether Kodi is using the video player or PAPlayer (audio).
Learning Linux the hard way !!
Reply
#5
Big Grin 
Thanks to this example I detected https://kodi.wiki/view/InfoLabels
With that example and with that list I'm now able to get all information I need.

Thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
How to get the current played title of a Radio stream?0