URI of playlist file

Just put together a Raspberry Pi 3 with OSMC and basic Kodi. I have a USB thumb drive with all of my mp3 files on it plugged into the Pi. Thumb drive name is PIMUSIC with all of the mp3 files in the root directory. I have several playlists (ex. Trance, Christian, Rock, Pop). Everything is working properly. If my ip address of the Pi is 192.168.0.51 what is the full URI of the Trance playlist? I am using Windows 10 to write a webcore piston to play a particular playlist and need the URI for the play command.

Your words are a bit confusing. How to you want to trigger that playlist? Via Kodi by using the Webserver and json API?

My intention is to hard code the uri in the piston. I do not have to parse a json. Kodi Music Player is my “Sonos”. Example :

With
Kodi Music Player
do
Speak Text “Honey I am home” and Resume;
Play Playlist “URI of my playlist.xsp file”;

I am having trouble determining the syntax of the URI for the Kodi playlist.xsp file. The playlist files are on my Pi at $HOME/.Kodi/userdata/playlists/. Not sure that I can initiate a playlist like this.

Realistically, I could just say “Alexa, tell Kodi to play my Trance playlist” and that would work. But I was hoping to automate that with the webcore piston. Thanks for you help.

So you want your Sonos to play the Playlist from your Pi? Than you first need to share it with (UPNP, Samba or NFS) and depending which one you choose determines the URI

Yes, I am using Samba.

For Samba the URI should be smb://<IP of OSMC>/osmc/.kodi/userdata/playlist/

1 Like

Thanks for the help. Trying multiple iterations of the above uri but no success yet. I will keep trying.

Cannot get this to work. Now just attempting to play an mp3 file instead of a playlist. Here is the uri I am using in the webcore piston with Play Track - \\Osmc\pimusic\Music\The Cars - Drive.mp3
If I put that in my browser, it plays. If I put that in Windows Explorer, it plays. Nothing plays with the webcore command.

Since you can access it via other methods, I’d suggest that you reach out to the webcore team to get more help.

Follow up for those trying to do the same thing I am. This has probably been figured out and posted elsewhere but I could not find it. I can now play single mp3 files through Kodi with a webcore routine. Here is my setup and code.

I have a Raspberry Pi 3+ running OSMC kodi. It is connected to my home network. I am writing Webcore code on my Windows 10 desktop that is on the same network. My entire music collection is on a USB flash drive plugged into the Raspberry. My music files are in a directory Music.

OSMC%20music%20directory

I accessed Kodi from my PC and played a song. I went into the song info looking for the URL (in Kodi). This is what I found :

So I put that URL into my Webcore code. Here is my Webcore code:

OSMC%20Kodi%20Webcore%20play%20track%20code

IT WORKED!!!

Now I can just change the name of the song and it works. Not sure why the “/media/” has to be in there. Can someone please explain that to me? Now to work on the URL for the playlist files. I will update as I succeed.

It’s because the /media/PIMUSIC is where you have the USB device mounted in the OSMC system (probably the USB is labelled PIMUSIC)), and you need the complete path to access it.
HTH
Derek

Derek,
Thanks. You are correct. I am very new to Debian so I was not sure why /media was in the path. Replacing the mp3 filename with a playlist name did not work. So I continue my efforts there.