Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    15

    Best method for extracting artist and album info from LMS?

    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

  2. #2
    Junior 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 ...

  3. #3
    Senior Member
    Join Date
    May 2008
    Location
    United States
    Posts
    8,218
    Quote Originally Posted by JohnQCitizen View Post
    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 ...
    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

  4. #4
    Senior Member aubuti's Avatar
    Join Date
    Oct 2005
    Posts
    8,373
    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.

  5. #5
    Junior Member
    Join Date
    Aug 2012
    Posts
    15
    Quote Originally Posted by garym View Post
    why not just point mp3tag at the same top music folder as LMS is using, then FILE > EXPORT, [...]
    Thanks for the link to mp3tag, but an ulterior motive of mine is learning how to communicate with the squeezebox server.

  6. #6
    Senior Member gharris999's Avatar
    Join Date
    Apr 2005
    Location
    Santa Fe, NM
    Posts
    3,303
    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.

  7. #7
    Junior 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.

  8. #8
    Senior Member gharris999's Avatar
    Join Date
    Apr 2005
    Location
    Santa Fe, NM
    Posts
    3,303
    Quote Originally Posted by JohnQCitizen View Post
    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).
    Here's a Firefox extension that will allow you to browse the .db file: https://code.google.com/p/sqlite-manager/

  9. #9
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    10,356
    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:
    Code:
    {
        "id":1,
        "method":"slim.request",
        "params":[ 
              "-", 
              ["albums",0,10000,"tags:lya" ]
        ]
    }
    Which will return 10 000 albums in JSON format and for each album return id, title, year and album artist name.

    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.

  10. #10
    Junior 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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •