Pandora plugin fails to decode, to many CURL redirects

Volumio 2.383
on a PineA64

Hey all,
Just in the last day 10/19/18, when playing a station in the Pandora plugin I get the following notification

Nothing had changed about the instance, had been running fine for months.
While nothing plays the Playback window shows a track which would be in that station and the play timer is going, when it reaches the end of the track it loads another with a similar CURL failed error
Heres what I have done so far
Restarted device and plugin
reinstalled the plugin
reformatted SD card and did a fresh install of Volumio
installed the plugin
same thing

I am wondering if anyone else using the plugin has experienced this. The developer does not appear to have issue submission turned on on the GitHub page https://github.com/truckershitch/volumio-plugins/tree/master/plugins/music_service/pandora.

I have some experience combing through code but am not savy enough to really figure this out on my own.

Any insights are appreciated.

Thanks!

Just started getting this too…
Did you find a resolution?

Have not figured it out yet.

I am running on the Pine64 with a older release of Volumio and plan to switch to a Raspberry Pi 3 B+ for my setup, as I will be making a couple of these setups to be placed in the kids rooms as well. I am hoping that part of the issue is with the version of Volumio (I know it doesn’t completely make sense since everything was working and without any update of either the plugin or Volumio it started having the issue). It is likely something to do with how Pandora operates. I can run Pianobar independently on the same setup via SSH and do not have any issues.

For me this was a transient problem. Worked fine on day, had this issue the next, and on the third day and later no problem. No change at all to my setup, software, options, or anything else. It appears that the plugins gets a URL from pandora for the song and passes it to MPD. MPD uses CURL to open the stream and that where the problem occurs. I think by default curl allows 5 redirects. but really no reason for redirects at all.
If it’s working for you with another player then the problem is probably not at the Pandora end. My guess is its most likely the unofficial API the plugin uses to communicate with Pandora. But without better instrumentation (list the details of the HTTP comms) it’s not clear what’s going on.

Well it’s back so I dug deeper. Don’t know exactly whats going on here but I don’t think the problem is in the plugin.
I sniffed the session between my Volumio box and pandora. What appears to be happening is mpd is asking mediaserver-sv5-rt-1-v4v6.pandora.com for the stream, pandora is telling mpd is exists on 142.129.4.105.
mpd then asks 142.129.4.105 for the stream. It’s then told to look at mediaserver-sv5-rt-1-v4v6.pandora.com
And around and around and around it goes.

[code]GET /access/5531304281673987340.mp3?version=5&lid=1508473227&token=1dDvNVIVoN9ElUAXQr0CQWQ%2Fn9%2FuPiLdhJ38SxHtUt6LIloywqlUtxyVL8Qq4g%2FxrNxba%2BsWqREhrNoUgnUeEDy%2BzbVYfROzp0WRx9Ef5EtBViU9MQq4vWw%2Bc9CSeghpCTPb5I9CmueANLIXV9gq%2Bxb8Lfxt%2FjlXybs9yn06PdtwJnSHNscWfnYz6YF%2Beu53ZfwyPxecq7XT98%2FSDD%2FkLVDQtxlsc9eT96YdphnEgYAbjuTnkNar0lhLVzmi3Sc0%2BKr62QLoPtrbgdzpJuJlXPx%2B%2FVM8I%2Fje0QZ3g53rg4saxVhKj1a%2BIHslMEx8ZUWVsVNxCSj3HUP4kqX9Shtj3stDQxDt7jO%2BJgku2Kr0jTVhiZNjj8vh67XGQpCTnEdeW4PgLEMlCJVNSwzrTEiwBPNpYgR0fNYrD%2FeS80lN7JL8uET8fOEHqsk17ZsHXXcBHscOp71ejwx%2BE9rClL%2BMunY5oSnUIxAAxmt2u9YXqHHQNU3G7sjIxDUe4A9bSIWHi%2FX0blQP28ws1SLr%2FCQH1ExG%2F3YtIAWiHx2S0%2BAEWOYyNdFDQAgLtA%3D%3D

HTTP/1.1^M
User-Agent: Music Player Daemon 0.20.6^M
Host: mediaserver-sv5-rt-1-v4v6.pandora.com^M
Accept: /^M
Icy-Metadata: 1^M

HTTP/1.1 302 Found^M
Location: http://142.129.4.105:80/pdata/001a7713158208a9/mediaserver-sv5-rt-1-v4v6.pandora.com/access/5531304281673987340.mp3?version=5&lid=1508473227&token=1dDvNVIVoN9ElUAXQr0CQWQ%2Fn9%2FuPiLdhJ38SxHtUt6LIloywqlUtxyVL8Qq4g%2FxrNxba%2BsWqREhrNoUgnUeEDy%2BzbVYfROzp0WRx9Ef5EtBViU9MQq4vWw%2Bc9CSeghpCTPb5I9CmueANLIXV9gq%2Bxb8Lfxt%2FjlXybs9yn06PdtwJnSHNscWfnYz6YF%2Beu53ZfwyPxecq7XT98%2FSDD%2FkLVDQtxlsc9eT96YdphnEgYAbjuTnkNar0lhLVzmi3Sc0%2BKr62QLoPtrbgdzpJuJlXPx%2B%2FVM8I%2Fje0QZ3g53rg4saxVhKj1a%2BIHslMEx8ZUWVsVNxCSj3HUP4kqX9Shtj3stDQxDt7jO%2BJgku2Kr0jTVhiZNjj8vh67XGQpCTnEdeW4PgLEMlCJVNSwzrTEiwBPNpYgR0fNYrD%2FeS80lN7JL8uET8fOEHqsk17ZsHXXcBHscOp71ejwx%2BE9rClL%2BMunY5oSnUIxAAxmt2u9YXqHHQNU3G7sjIxDUe4A9bSIWHi%2FX0blQP28ws1SLr%2FCQH1ExG%2F3YtIAWiHx2S0%2BAEWOYyNdFDQAgLtA%3D%3D^M
Connection: close^M
X-Content-Type-Options: nosniff^M
Content-Type: text/html^M
Cache-Control: no-cache^M
Content-length: 0^M

GET /pdata/001a7713158208a9/mediaserver-sv5-rt-1-v4v6.pandora.com/access/5531304281673987340.mp3?version=5&lid=1508473227&token=1dDvNVIVoN9ElUAXQr0CQWQ%2Fn9%2FuPiLdhJ38SxHtUt6LIloywqlUtxyVL8Qq4g%2FxrNxba%2BsWqREhrNoUgnUeEDy%2BzbVYfROzp0WRx9Ef5EtBViU9MQq4vWw%2Bc9CSeghpCTPb5I9CmueANLIXV9gq%2Bxb8Lfxt%2FjlXybs9yn06PdtwJnSHNscWfnYz6YF%2Beu53ZfwyPxecq7XT98%2FSDD%2FkLVDQtxlsc9eT96YdphnEgYAbjuTnkNar0lhLVzmi3Sc0%2BKr62QLoPtrbgdzpJuJlXPx%2B%2FVM8I%2Fje0QZ3g53rg4saxVhKj1a%2BIHslMEx8ZUWVsVNxCSj3HUP4kqX9Shtj3stDQxDt7jO%2BJgku2Kr0jTVhiZNjj8vh67XGQpCTnEdeW4PgLEMlCJVNSwzrTEiwBPNpYgR0fNYrD%2FeS80lN7JL8uET8fOEHqsk17ZsHXXcBHscOp71ejwx%2BE9rClL%2BMunY5oSnUIxAAxmt2u9YXqHHQNU3G7sjIxDUe4A9bSIWHi%2FX0blQP28ws1SLr%2FCQH1ExG%2F3YtIAWiHx2S0%2BAEWOYyNdFDQAgLtA%3D%3D HTTP/1.1^M
User-Agent: Music Player Daemon 0.20.6^M
Host: 142.129.4.105^M
Accept: /^M
Icy-Metadata: 1^M

HTTP/1.1 302 Found^M
Server: nginx^M
Date: Fri, 16 Nov 2018 01:12:25 GMT^M
Content-Length: 0^M
Connection: keep-alive^M
Location: http://mediaserver-sv5-rt-1-v4v6.pandora.com/access/5531304281673987340.mp3?version=5&lid=1508473227&token=1dDvNVIVoN9ElUAXQr0CQWQ%2Fn9%2FuPiLdhJ38SxHtUt6LIloywqlUtxyVL8Qq4g%2FxrNxba%2BsWqREhrNoUgnUeEDy%2BzbVYfROzp0WRx9Ef5EtBViU9MQq4vWw%2Bc9CSeghpCTPb5I9CmueANLIXV9gq%2Bxb8Lfxt%2FjlXybs9yn06PdtwJnSHNscWfnYz6YF%2Beu53ZfwyPxecq7XT98%2FSDD%2FkLVDQtxlsc9eT96YdphnEgYAbjuTnkNar0lhLVzmi3Sc0%2BKr62QLoPtrbgdzpJuJlXPx%2B%2FVM8I%2Fje0QZ3g53rg4saxVhKj1a%2BIHslMEx8ZUWVsVNxCSj3HUP4kqX9Shtj3stDQxDt7jO%2BJgku2Kr0jTVhiZNjj8vh67XGQpCTnEdeW4PgLEMlCJVNSwzrTEiwBPNpYgR0fNYrD%2FeS80lN7JL8uET8fOEHqsk17ZsHXXcBHscOp71ejwx%2BE9rClL%2BMunY5oSnUIxAAxmt2u9YXqHHQNU3G7sjIxDUe4A9bSIWHi%2FX0blQP28ws1SLr%2FCQH1ExG%2F3YtIAWiHx2S0%2BAEWOYyNdFDQAgLtA%3D%3D^M
Cache-Control: no-cache^M
X-Content-Type-Options: nosniff^M
X-OC-Service-Type: lo^M
[/code]

So where is the redirected request going?

[code]nslookup 142.129.4.105
Server: UnKnown
Address: 192.168.1.1

Name: cpe-142-129-4-105.socal.res.rr.com
Address: 142.129.4.105
[/code]

Which appears to be a user in southern california. The actual Pandora servers are in the Bay area. so very fishy.

Just for fun I mod’d the Pandora plugin code to rewrite the stream URI to use the IP of the real Pandora server ( 208.85.42.36 ) rather than resolve it by DNS. With that code in place I can stream Pandora songs without issue.

I don’t know what this mean. Might be something is wrong with the Pandora server as it responds differently depending whether you talk to it by name or address. Might be something in the internet is doing a man-in-the-middle and intercepting the traffic, perhaps with DNS poisoning. Or maybe it’s just the Pandora devs making updates or playing with the unsupported API.

:frowning:

@srhamil

Thats does seem odd, thanks for posting your findings.

I had shelved using the Pandora plugin for a little while since originally posting and checked back last week, the results appeared to be unchanged so I stood up and walked away, 5 minutes later music just started playing and it was from pandora as I hadn’t paused the stream or changed to something else. So I suppose its similar to the intermittency you were experiencing. I will try modding the plugin as you did to see if that consistently resolves the issue.
I assume the issue does have to do with Pandora’s end of things, might be worth posting a PR to the plugin to update the IP.

It would be interesting to see which ip pianobar calls to since the plugin I think utilizes the pianobar CLI to access pandora.

Would you mind sharing your mod’d code for the plugin?

Thanks

I’ll put up a version in github. Might be a couple of days though…

@adamguenter,
I cleanup up the code some and put the work-around on a configuration switch. (Plugins/Installed Plugins/Pandora/ : ).
You can find the code here: github.com/srhamil/volumio-plugins. Same install procedures. I completely removed the old plugin and installed the new version.

If you find it effective I ask for it to be pulled into the main development branch.

r/

@srhamil

I installed your fork of the plugin and it works like a charm.
I especially like the config switch, very slick.
I do not know what the author of the original plugin would think, but I would recommend you put in the pull request from your fork. Especially since the work around you wrote is optional with the config switch.

Thanks for your work on helping me with this. And reviewing your code changes helped me better understand the plugin code. As someone who can sometimes figure out things in code and mess with it but does not have the knowledge to really do a whole lot of coding, I learn by seeing what others have done.

Cheers

Yes, I did issue a pull request. I think that the end for this thread.

Hey, @truckershitch here. I merged @srhamil 's pull request, the plugin was merged into the main Volumio code base, and the plugin can now be installed with the latest build of Volumio with just a few clicks.

I only just saw this thread today, but @srhamil and I spoke about this late last year. I was glad for the help.

If you see any more issues, don’t hesitate to contact me with a PM. I don’t seem to get any notifications at all for this forum, and I don’t check it every day, but I’ll do my best to resolve issues as I am made aware of them.

Thanks! Enjoy the plugin.