0

I'm trying to figure out how to get the playing item URL (live TV). I tried overriding Player but couldn't get the play method to be called and looked at jsonRPC calls, but couldn't find anything resembling what I want. Is there a way to do it?

On another issue, I want to use ffmpeg and I noticed that Kodi already uses it. Is there a way I can reuse it or should I download the executable file myself?

EDIT

I'm trying to develop an addon/script - I need a method for finding out the URL currently played from XBMC builtins.

Ofir
  • 1,565
  • 3
  • 23
  • 41

1 Answers1

0

You can try Player.Filename infolabel like this:

filename = xbmc.getInfoLabel('Player.Filename')

Or you can use Player.GetItem JSON-RPC method.

UPD: This is a snippet from one of my addons:

def get_now_played():
"""
Get info about the currently played file via JSON-RPC.

:return: currently played item's data
:rtype: dict
"""
request = json.dumps({'jsonrpc': '2.0',
                      'method': 'Player.GetItem',
                      'params': {'playerid': 1,
                                 'properties': ['file', 'showtitle', 'season', 'episode']},
                      'id': '1'})
return json.loads(xbmc.executeJSONRPC(request))['result']['item']

As for ffmpeg libraries, they are linked with Kodi so I doubt that you can re-use them.

Roman Miroshnychenko
  • 1,496
  • 1
  • 10
  • 16
  • I've edited my question, thanks. I'm trying to develop an addon - can't look at the log (although I did see that the URL is there) – Ofir Jul 18 '16 at 13:54
  • I'm afraid that Player.Filename doesn't hold the URL for live-tv (I got "pvr.iptvsimple_1702591772.pvr") – Ofir Jul 19 '16 at 15:03