Announcement

Collapse
No announcement yet.

Play specific favorite via JSONRPC API

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Play specific favorite via JSONRPC API

    Hello,

    Is it possible to play a specific favorite via the JSONRPC API?

    Can not find how to do it, would like to use it to play certain radio stations via the API who are currently in the favorite list.

    Many thanks.

    #2
    I assume you know how to construct call, here is how we do it in pCP.

    You need to reference the ID of the favorite. The command: favorite items 0 100

    Will return the names and id numbers of all of your favorites.

    Then to play: favorites playlist play item_id:xx
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

    Comment


      #3
      Originally posted by paul- View Post
      I assume you know how to construct call, here is how we do it in pCP.

      You need to reference the ID of the favorite. The command: favorite items 0 100

      Will return the names and id numbers of all of your favorites.

      Then to play: favorites playlist play item_id:xx
      Hello,

      Thanks, not sure how to apply the option mentioned above.

      I am now sending the command below to http://xx.xx.xx.xx:9000/jsonrpc.js to stop playing and change stop to play to start playing. How to integrate the above?
      {"id":0,"params":["xx:xx:xx:xx:xx:xx",["stop"]],"method":"slim.request"}

      Comment


        #4
        Here is the request to get a list of favorites

        Code:
        {"id":1,"method":"slim.request","params":[ "-", ["favorites","items","0","100"]]}
        That will return JSON output of your favorites. You only need to do this when you need to figure out the id of your favorites.......

        Code:
        {"id":1,"result":{"loop_loop":[
           {"id":"81ad1ed6.0","name":"MIX 107.7 WMMX-FM","type":"audio","image":"https://i.iheart.com/v3/re/assets/images/8c5f9c8e-6dea-4bfc-88fa-e9249bf07ea3.png","isaudio":1,"hasitems":0},
           {"id":"81ad1ed6.1","name":"104.7 WTUE WTUE-FM","type":"audio","image":"https://i.iheart.com/v3/re/assets/images/1785.png","isaudio":1,"hasitems":0}],"title":"Favorites","count":2},
        "method":"slim.request","params":["-",["favorites","items","0","10"]]}

        Figure out which id you want to play......and just play them like this. Replace "piCorePlayer" with the name of your player (or mac address of your player)

        Code:
        {"id":1,"method":"slim.request","params":[ "piCorePlayer", ["favorites","playlist","play","item_id:81ad1ed6.0"]]}
        piCorePlayer a small player for the Raspberry Pi in RAM.
        Homepage: https://www.picoreplayer.org

        Please donate if you like the piCorePlayer

        Comment


          #5
          Originally posted by paul- View Post
          Here is the request to get a list of favorites

          Code:
          {"id":1,"method":"slim.request","params":[ "-", ["favorites","items","0","100"]]}
          That will return JSON output of your favorites. You only need to do this when you need to figure out the id of your favorites.......

          Code:
          {"id":1,"result":{"loop_loop":[
             {"id":"81ad1ed6.0","name":"MIX 107.7 WMMX-FM","type":"audio","image":"https://i.iheart.com/v3/re/assets/images/8c5f9c8e-6dea-4bfc-88fa-e9249bf07ea3.png","isaudio":1,"hasitems":0},
             {"id":"81ad1ed6.1","name":"104.7 WTUE WTUE-FM","type":"audio","image":"https://i.iheart.com/v3/re/assets/images/1785.png","isaudio":1,"hasitems":0}],"title":"Favorites","count":2},
          "method":"slim.request","params":["-",["favorites","items","0","10"]]}

          Figure out which id you want to play......and just play them like this. Replace "piCorePlayer" with the name of your player (or mac address of your player)

          Code:
          {"id":1,"method":"slim.request","params":[ "piCorePlayer", ["favorites","playlist","play","item_id:81ad1ed6.0"]]}
          Great, works perfect!! Many thanks!!

          Comment

          Working...
          X