URL's when MM5 is a server (especially playlists)

To discuss development of addons / skins / customization of MediaMonkey.

Moderator: jiri

Linwood
Posts: 63
Joined: Sat Jul 13, 2019 6:49 pm
Contact:

URL's when MM5 is a server (especially playlists)

Post by Linwood »

I created a complex mess this weekend to get a bunch of things playing from automation and various screens. Kind of a mess but it works great.

One aspect of it is that I am using VLC as a media player and renderer on linux, because MM5 doesn't live there (at least not happily, plus it cannot be remote controlled).

VLC in turn connects to MM5 as a DLNA (uPnP) server. When running in the VLC GUI that is fine, there is a reasonably usable interface from browsing the DLNA tree from MM5.

However, when I want to play a track from my home automation system, I need the explicit URL that is used to pull from MM5. That turns out to be easy for individual tracks, it appears to look like this:

Code: Select all

http://MM5_IPaddress:13669/ItemID=6453.m4a
I can invoke VLC from the automation system, pass that URL into VLC, and VLC connects to MM5 and plays that track. Works great. I got that from experimentation, I cannot find it documented. It's nice and easily derived from the database info.

However, when I want to do a playlist the URL is really ugly:

Code: Select all

upnp://http://MM5_IPaddress:13669/ContentDirectory/b43a64cc-4017-4f19-b0f9-bc2376a75708/control.xml?ObjectID=0\Playlists\9bb06925-412d-4403-ab76-d80c89239485
This one is a mess, I have no idea where to get this from the database. Worse, I did a reinstall of MM5 for a new version (and switched from non- to portable, but moved over the catalog) and the numbers all changed for the same list, so not sure how stable they are.

Is there a documented structure to these URL's, or one that you would be willing to share?

Something I could script (with a bit of SQL) from the database? My library rarely changes, so my thinking is to script the right URL's and load the resulting file into my automation system.

Pulling them by hand from VLC's info pane is a real pain. It works, but takes forever if there are many playlists.

If there's documentation for this please point me to it, I may simply have missed it. Thanks,

Linwood
Ludek
Posts: 3418
Joined: Fri Mar 09, 2007 9:00 am
Contact:

Re: URL's when MM5 is a server (especially playlists)

Post by Ludek »

Hi,

Code: Select all

upnp://http://MM5_IPaddress:13669/ContentDirectory/b43a64cc-4017-4f19-b0f9-bc2376a75708/control.xml?ObjectID=0\Playlists\9bb06925-412d-4403-ab76-d80c89239485
Port 13669 is port of the MM5 server and you can change it in Tools > Options > Media Sharing (or the port can be read from the MM5.DB > MediaServers table)

To get GUID of the content directory:
Put http://MM5_IPaddress:13669/DeviceDescription.xml into your browser address bar and you will see the <controlURL> element of the ContentDirectory service which is /ContentDirectory/b43a64cc-4017-4f19-b0f9-bc2376a75708/control.xml in your case.

To get GUID of the playlist: See table playlists in the MM5.DB and the column GUID, it is 9bb06925-412d-4403-ab76-d80c89239485 for your playlist

Note that I also uncovered another possibility, see the brief MM5 web version description here: https://www.mediamonkey.com/forum/viewt ... 30&t=95433 -- which may also help you.
Linwood
Posts: 63
Joined: Sat Jul 13, 2019 6:49 pm
Contact:

Re: URL's when MM5 is a server (especially playlists)

Post by Linwood »

Thank you. I think I must have been going blind when I looked, or concentrating too much on that first guid, but this looks straightforward, and simple enough to pull out.

I think for what I want I can just script some SQL to build the YAML I need to incorporate into Home Assistant as "scripts" which become a routine for google assistant. So I can say something like "Hey Google, Activate Pianodisc Background Classical" or some such and have the player piano play a playlist. I've about got everything else fixed so should be able to give it a go today.
Post Reply