I am looking at writing a small app that extracts information from my Squeezebox server (Logitech Media Server Version: 7.7.2 - r33893).
In particular I want to extract a list of artists + albums that I can carry with me whenever I am off line (I have a bad habit of not knowing if I already own a CD when I'm out buying music).
What's a simple way of connecting to the server and pulling out this data? I see that there's a command line interface for telnet, and there's a HTTP interface. The telnet CLI looks like it might return the required data, not sure about the HTTP interface.
There's also slimproto traffic on port 3483 from my various squeezebox players. The players show artist/album information but I'm not sure how to request this information (I assume that info is sent from the server in response to IR notifications).
Are there any other methods for getting this information from the server that I am overlooking?
Thanks
Results 1 to 10 of 15
-
2012-08-21, 00:46 #1Junior Member
- Join Date
- Aug 2012
- Posts
- 15
Best method for extracting artist and album info from LMS?
-
2012-08-21, 05:05 #2Junior Member
- Join Date
- Aug 2012
- Posts
- 15
So I used CLI and got the information that I needed. Opened a socket to port 9090 on the host where LMS was running and sent various commands and parsed the strings returned. Not terribly efficient but I got a nice text file with list of artists and each album for that artist, which I'll periodically download to my phone for perusal when I'm out looking for new music.
The next step is to remove the hard-coded server address and discover servers automatically. I did try getting server information directly by sending the request "eIPAD\0NAME\0VERS\0JSON\0" (as seen in the slimproto source code, an 'e' to prepend and a sequence of zero-length TLVs) via UDP to port 3483 of the host running LMS (version 7.7.4) but got no response. More investigation required here ...
-
2012-08-21, 05:36 #3Senior Member
- Join Date
- May 2008
- Location
- United States
- Posts
- 8,218
why not just point mp3tag at the same top music folder as LMS is using, then FILE > EXPORT, then choose on of the export configurations (e.g., Album list only, album, song, etc.). This will create a CVS (spreadsheet) file with only a couple of mouse clicks. Can't recall, but you may need to install some of the extra configuration files. See these:
http://forums.mp3tag.de/index.php?sh...configuration\Location 1: VortexBox Appliance 6TB (2.2) > LMS 7.7.2 > Transporter, Touch, Boom, Radio w/Battery (all ethernet)
Location 2: VBA 3TB (2.2) > LMS 7.7.2 > Touch > Benchmark DAC I, Boom, Radio w/Battery (all ethernet except Radio)
Office: Win7(64) > LMS 7.7.2 > SqueezePlay
Spares: VBA 4TB, SB3, Touch (3), Radio (3), CONTROLLER
Controllers: iPhone4S (iPeng), iPad2 (iPengHD & SqueezePad), CONTROLLER, or SqueezePlay 7.7 on Win7(64) laptop
Ripping (FLAC) - dbpoweramp, Tagging - mp3tag, Spotify
-
2012-08-21, 05:52 #4
Or if you're looking for what may be a middle ground between CLI and mp3tag, there are various SQLite tools that can work with LMS's database to extract the relevant info in an organized way.
-
2012-08-21, 06:25 #5Junior Member
- Join Date
- Aug 2012
- Posts
- 15
-
2012-08-21, 07:25 #6
There really ought to be a simple plugin for this. But absent that, what about opening a new browser window and pointing it at:
http://YOUR_LMS_IP:9000/clixmlbrowse...By=artistalbum
Then use the widget at the left bottom of the window to turn off artwork. At least this way you'll get a list of all albums, sorted by Artist in a series of pages you can print out.
-
2012-08-21, 16:22 #7Junior Member
- Join Date
- Aug 2012
- Posts
- 15
Hmmm ... pulling the data straight out of the SQL database sounds interesting. I might do that just for fun (though the .db file eludes me right now).
But, my ultimate goal is to write a wee app for my phone that pulls the artist/album information from the server and stores it internally. I press a button on my phone and the internal artist/album list is updated and viewable in a nice format for later. Fetching data via CLI may be the simplest solution.
-
2012-08-21, 22:46 #8
Here's a Firefox extension that will allow you to browse the .db file: https://code.google.com/p/sqlite-manager/
-
2012-08-22, 09:07 #9
You can use the Database Query plugin, this makes it possible to define reports using SQL statements and then request a XML file like for example:
http://<serverip>:9000/plugins/DatabaseQuery/databasequery_executedataquery.binfile?type=albums &as=xml
The contents of the XML is defined in the SQL statement you have defined in the report, there are some predefined reports for albums, artists, songs included in the plugin.
If you want a nicely formatted report there is also Album Catalog Creator (http://acc.vanholt.nl/) but it probably doesn't fit your use case of a phone app.
However, the best solution if you want to use this from a mobile app is probably just to use the JSON-RPC api and send a HTTP POST request to:
http://<serverip>:9000/jsonrpc.js
With content like:
Which will return 10 000 albums in JSON format and for each album return id, title, year and album artist name.Code:{ "id":1, "method":"slim.request", "params":[ "-", ["albums",0,10000,"tags:lya" ] ] }
You will find the commands available in the CLI documentation included in SBS/LMS web interface under "Help/Technical Information", the "albums" command shown above was just an example.Erland Isaksson (My homepage)
(Developer of many plugins/applets (both free and commercial).
If you like to encourage future presence on this forum and/or third party plugin/applet development, consider purchasing some plugins)
You may also want to try my Android apps Squeeze Display and RSS Photo Show
Interested in the future of music streaming ? ickStream - A world of music at your fingertips.
-
2012-08-25, 16:43 #10Junior Member
- Join Date
- Aug 2012
- Posts
- 15
So I wrote a wee Android app that queries the Squeezebox server and displays the catalog, first by artist and then by albums for that artist. I took the easy option of sending a CLI requests for album information.
Then JSON interface looks interesting but I looked for information on the message structure on the technical help pages of the server but it only mentions the CLI interface. Is there a direct link that I am missing, or is the structure always ["id":1, "method":"slim.request", "params": [ ... ] ], where "..." is the CLI request as an array of strings?

Reply With Quote

