Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 4 of 4
  1. #1

    spotty, get title from url in "name"?

    I have been exploring the json RPC interface to the LMS, and I was a bit confused by spotty/spotify track names. Any info on how to get the name from something like:

    spotify://track:12341234

    Here is the response I got for example for my album fav


    Code:
    {
        "params": [
            "11:22:33:44:55:95",
            [
                "favorites",
                "items",
                "0",
                "199",
                "item_id:7"
            ]
        ],
        "result": {
            "title": "Baby Driver (Music from the Motion Picture) by Various Artists",
            "loop_loop": [
                {
                    "id": "7.0",
                    "name": "spotify://track:7sC9FifCXZHgjTAjFO1ykA",
                    "type": "audio",
                    "isaudio": 1,
                    "hasitems": 0
                },
                {
                    "id": "7.1",
                    "name": "spotify://track:4K5OFH9lQKVebny27xmgW4",
                    "type": "audio",
                    "isaudio": 1,
                    "hasitems": 0
                },
    ...

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,503

    spotty, get title from url in "name"?

    > I have been exploring the json RPC interface to the LMS, and I was a bit
    > confused by spotty/spotify track names. Any info on how to get the name
    > from something like:
    >
    > spotify://track:12341234


    I'm not sure you can do this easily using LMS without any additional
    code. It's easy if it's the playing track, or in the queue, or imported
    into the local library (LMS 8+). But there's no generic "give me info
    about track xyz" call for Spotify.

    What are you trying to do?

    --

    Michael

  3. #3
    Hi Michael,
    Thanks for the reply. So I'm writing a way to control my picore players and I just wanted a list of songs under the spotify album. So the json rpc works to get that as you said for local music, but having these spotify names as url's is just annoying. Is there some way to look up the songs in an album another way versus this command? I tried going one level down for each song but that just gives more of the same:

    Code:
    {
        "params": [
            "11:22:33:44:55",
            [
                "favorites",
                "items",
                "0",
                "199",
                "item_id:7.0"
            ]
        ],
        "method": "slim.request",
        "id": 0,
        "result": {
            "count": 1,
            "loop_loop": [
                {
                    "id": "7.0",
                    "name": "spotify://track:7sC9FiCXZHgjTAjFO1ykA",
                    "isaudio": 1,
                    "value": "spotify://track:7sC9FiCXZHgjTAjFO1ykA",
                    "url": "spotify://track:7sC9FiCXZHgjTAjFO1ykA",
                    "type": "audio"
                }
            ]
        }
    }

  4. #4
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,503

    spotty, get title from url in "name"?

    > Thanks for the reply. So I'm writing a way to control my picore
    > players and I just wanted a list of songs under the spotify album. So
    > the json rpc works to get that as you said for local music, but having
    > these spotify names as url's is just annoying. Is there some way to
    > look up the songs in an album another way versus this command? I tried
    > going one level down for each song but that just gives more of the
    > same:


    As you're writing your own code outside LMS I'd recommend you use the
    Spotify web API. You should have your own client ID already to work
    around the 429 issues in Spotty. Use the same client ID to get
    information about the track using eg.
    https://developer.spotify.com/docume...cks/get-track/.
    It's likely much easier for you as you can use the tools you know in
    your environment and have a well documented API which offers all the
    features Spotify has.

    --

    Michael

Posting Permissions

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