Command to get current playing filename (not title)
#1
Hi, I'm looking for a command to get the current playing filename (so not just the currently playing movie title).
Example: moviename 1080p DTSHD.mkv 

Is there a (curl?) command I can use? Preferable a command with username and password in the example.
Something I could use in Home Assistant? Would love to run a script from HA to get the current playing filename from Kodi.

There is a Kodi integration in HA but that shows the movie title and not the filename. 

Tia.
Reply
#2
Anybody? Would really love this getting this to work. 
Want too use it to automatically control a masking system for my projection screen.
Reply
#3
python:

jsonRequest = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id": 1, "method": "Player.GetItem", "params": {"properties": ["file"], "playerid": 1}}')
filePath = json.loads(jsonRequest.encode("utf-8"))["result"]["item"]["file"]
fileName = os.path.basename(filePath)


http://localhost:8080/jsonrpc?request={"jsonrpc": "2.0", "id": 1, "method": "Player.GetItem", "params": {"properties": ["file"], "playerid": 1}}
Reply
#4
Thank you very much!! that works.
Now the next step is getting the "file" data into Home Assistant, will post a question on the HA forum.
Reply
#5
How would one do this in BASH from an RPi4 running Raspbian ?

Thanks

Rembrandt
Reply

Logout Mark Read Team Forum Stats Members Help
Command to get current playing filename (not title)0