pianobar icon indicating copy to clipboard operation
pianobar copied to clipboard

[Feature Request] Support for replay song

Open redog opened this issue 9 years ago • 13 comments

Pandora Plus includes unlimited song skips and now support replaying the current song.

pianobar should include support for this feature.

redog avatar Dec 02 '16 16:12 redog

You’re talking about https://help.pandora.com/customer/en/portal/articles/2590339-replays, right?

There’s a new method onDemand.getReplayTrack, which probably does what we’re looking for. However calling it fails with error code 9 (parameter missing) and I can’t figure out which one is missing. If someone figures out how to call that method I’ll have a look.

Simply reusing the known audio urls might be too fragile. They expire after some time.

PromyLOPh avatar Dec 03 '16 10:12 PromyLOPh

https://www.pandora.com/api/v1/ondemand/getReplayTrack is only available if you've watched an ad on the desktop version and says "Replay not available" otherwise ( my experience, also https://help.pandora.com/customer/en/portal/articles/2590339-replays ). Headers:

Host: www.pandora.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 Accept: application/json, text/plain, / Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/json X-AuthToken: [EDITED] X-CSRFToken: [EDITED] Referer: https://www.pandora.com/station/play/[EDITED]/history Content-Length: 251 Cookie: wrt=[EDITED]; v2regbstage=true; at=[EDITED]; v3ad=[EDITED]; pwc-2016=true; csrftoken=[EDITED]; _sl_path=/station/play/[EDITED] DNT: 1 Connection: keep-alive

https://www.pandora.com/api/v1/ad/useReplayReward had response: replaysRemaining:1

useReplayReward and getReplayTrack are also used if you watch an ad and then switch on an adblocker of some type ( uBlock Origin or the like ).

Let me know if you need me to get you anything else.

Lvl4Sword avatar May 19 '17 07:05 Lvl4Sword

Note that pianobar is using the mobile API at tuner.pandora.com/services/json/ which is slightly different. I need request url, request data and response data.

PromyLOPh avatar May 19 '17 11:05 PromyLOPh

Hi folks, just found this while utilizing the windows binaries (https://github.com/thedmd/pianobar-windows-binaries) - if you pause the track with 0 seconds remaining, resuming will cause it to play from the beginning. I tested this a few times and got a song to play back 3 times. It's a bit of a hack but that could be reproduced in a feature pretty easily if the user indicates they wish to loop the current track.

normancroan avatar Jun 13 '17 14:06 normancroan

That’s a bug in the Windows port. It does not work here.

PromyLOPh avatar Jun 15 '17 05:06 PromyLOPh

is there any way to access the pianobar cache to replay?

hatcreek68 avatar Mar 25 '18 00:03 hatcreek68

There is no song cache.

PromyLOPh avatar Mar 25 '18 08:03 PromyLOPh

Ok, it just streams the current song URL? Can the current song URL be posted to patiobar or a text file? Similar to the current song text file that gets overwritten?

hatcreek68 avatar Mar 25 '18 10:03 hatcreek68

The file is streamed and its URL is not available to eventcmd scripts for obvious reasons.

PromyLOPh avatar Mar 25 '18 14:03 PromyLOPh

Hey, if you want to keep it hidden, your call 100%; but here's some reasons it's NOT obvious to me to keep it hidden.

  1. pianobar is already accessing that URL to stream...
  2. You can legally record to the radio (over the air radio), for personal use. Also see VCR/PVR debate...
  3. If you go to pandora.com, play a song. Legally. Hit F12, observe the song URL. Go to said URL, it will work for a limited time. Does pandora want you to do this? Probably not. but it's just a URL made available to listen the a song, paid for by ads between x many songs.
  4. You can even straight download the song from the URL w/ 1 click - and own the consequences of doing so if you breach any law and/or terms of service - but pandora itself doesn't prevent this.
  5. Pandora lets you replay instantly on the mobile app, for the price of 1 ad; would be cool to integrate replay in pianobar (using ads or paid pandora one account). Pianobar is already adfree - so it's a dance here. We follow SOME rules but not all of them....... would be better to just commit one way or the other. Maybe REQUIRE pandora one accounts to use pianobar to mitigate legal issues?

example 1 - observe song URL straight from pandora.com example 2 - said URL functions for some amount of time for a reply

hatcreek68 avatar Mar 25 '18 20:03 hatcreek68