PromyLOPh / pianobar

Console-based pandora.com player
http://6xq.net/pianobar/
Other
1.74k stars 321 forks source link

Pandora Modes #700

Closed github-account1111 closed 3 years ago

github-account1111 commented 4 years ago

Subject of the issue

Wondering if it's possible to switch from the default playback to, say, Discovery. I have not been able to find anything about that in regard to Pianobar.

Your environment

PromyLOPh commented 4 years ago

I don’t know how they’re implemented, but if someone reverse-engineers the API calls required, it might be possible to implement. pianobar focuses on stations, because that’s Pandora’s original design (note that pianobar is already 12 years old).

github-account1111 commented 4 years ago

I think modes are per station. Pandora themselves describe it as "tuning your station." Actually I'm wondering if Pianobar already does this. If I change the mode in the web interface, next time I log in it's still using that mode. So perhaps if I open the same station from Pianobar it does the same. All speculation of course.

PromyLOPh commented 4 years ago

Sounds like persistent/server-side per-station settings to me. There is a method station.changeSettings, but I don’t know how to call it, i.e. what the settings could be. Can you capture the HTTP request when changing this setting?

github-account1111 commented 3 years ago

Will this do?

https://gist.github.com/github-account1111/fe3baf8f1a9f081585012b1b0b52fd55

During network capture I switch from Discovery to My Station and back to Discovery. I've no clue why it's so huge. I only captured a couple seconds..

PromyLOPh commented 3 years ago

Yeah, thanks. So it looks like the API is called interactiveradio.v1.setAndGetAvailableModes. It accepts a stationId and modeId. There’s also interactiveradio.v1.getAvailableModesSimple, which only accepts a stationId and probably retrieves the available modes, which are currently:

{
  "result": {
    "interactiveRadioAvailable": true,
    "currentModeId": 0,
    "availableModesHeader": "Choose a mode to fine-tune your station",
    "takeoverModesHeader": "Exclusive Curated Modes",
    "availableModes": [
      {
        "representativeTracks": [],
        "isModeAvailable": true,
        "modeId": 0,
        "modePandoraId": "MO:0",
        "modeName": "My Station",
        "modeButtonText": "My Station",
        "modeDescription": "The station experience you know and love.",
        "isPremiumOnly": false,
        "isTakeoverMode": false,
        "isAlgorithmicMode": true
      },
      {
        "representativeTracks": [],
        "isModeAvailable": true,
        "modeId": 1,
        "modePandoraId": "MO:1",
        "modeName": "Crowd Faves",
        "modeButtonText": "Crowd Faves",
        "modeDescription": "You’ll hear the most Thumbed Up songs by other listeners.",
        "isPremiumOnly": false,
        "isTakeoverMode": false,
        "isAlgorithmicMode": true
      },
      {
        "representativeTracks": [],
        "isModeAvailable": true,
        "modeId": 2,
        "modePandoraId": "MO:2",
        "modeName": "Discovery",
        "modeButtonText": "Discovery",
        "modeDescription": "You’ll hear more artists who don’t usually play on this station.",
        "isPremiumOnly": false,
        "isTakeoverMode": false,
        "isAlgorithmicMode": true
      },
      {
        "representativeTracks": [],
        "isModeAvailable": true,
        "modeId": 3,
        "modePandoraId": "MO:3",
        "modeName": "Deep Cuts",
        "modeButtonText": "Deep Cuts",
        "modeDescription": "You’ll hear less familiar songs from station artists.",
        "isPremiumOnly": false,
        "isTakeoverMode": false,
        "isAlgorithmicMode": true
      },
      {
        "representativeTracks": [],
        "isModeAvailable": true,
        "modeId": 4,
        "modePandoraId": "MO:4",
        "modeName": "Newly Released",
        "modeButtonText": "Newly Released",
        "modeDescription": "You’ll hear the newest releases from station artists.",
        "isPremiumOnly": false,
        "isTakeoverMode": false,
        "isAlgorithmicMode": true
      },
      {
        "representativeTracks": [],
        "isModeAvailable": true,
        "modeId": 5,
        "modePandoraId": "MO:5",
        "modeName": "Artist Only",
        "modeButtonText": "Artist Only",
        "modeDescription": "You’ll only hear songs from the station artist.",
        "isPremiumOnly": true,
        "isTakeoverMode": false,
        "isAlgorithmicMode": true
      }
    ],
    "hasTakeoverModes": false,
    "annotations": {}
  },
  "stat": "ok"
}

Should be fairly easy to implement as well.

PromyLOPh commented 3 years ago

Done, you’ll find it in the '=' menu.

github-account1111 commented 3 years ago

Thanks! For this and for the remaining time feature.