Kodi Community Forum

Full Version: Is there a way to retrieve the url?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I am trying to find a way to retrieve the url of the currently playing video/audio stream using json.
I tried "Player.Filename" and it returned "videoplayback". Great. Wink

Any help would be appreciated, thanks!
(2016-11-15, 21:39)widardd Wrote: [ -> ]I am trying to find a way to retrieve the url of the currently playing video/audio stream using json.
Try Playlist.GetItems, the player method has only limited info about the file playing, the playlist method has more.

jonib
PHP Code:
{"jsonrpc""2.0""method""Player.GetItem""params": { "properties": [ "file"], "playerid"'"1"' }, "id""AudioGetItem"

That should get you the filename if its a local file, or the full URL if it's a stream.

Example call (from bash)

PHP Code:
curl ---data-binary '{"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": [ "file"], "playerid": '"1"' }, "id": "AudioGetItem"}' -'content-type: application/json;' http://localhost:9001/jsonrpc 

Result

PHP Code:
{"id":"AudioGetItem","jsonrpc":"2.0","result":{"item":{"file":"http://icy-e-bz-08-boh.sharp-stream.com:8000/viking.mp3","label":"viking.mp3","type":"unknown"}}}