truckershitch / volumio-plugins

4 stars 4 forks source link

Pandora Plugin installation #3

Open hemlockpa opened 4 years ago

hemlockpa commented 4 years ago

Installed Pandora plugin 2.3.0 on Volumio 2.806. Install reports completed OK but Pandora icon doesn't populate into Browse screens. Installed Podcast plugin as a comparison and that does populate its icon to the Browse window. Any suggestions on how to go about debugging this?

truckershitch commented 4 years ago

I'm also having issues. It started this afternoon. I had a track expire on me and I wrote a fix that should work for v2.3.1 (which you can checkout here on the default master branch). I wanted to test my code and then I got the same error.

I was using v2.3.0 this morning. I installed it from the Volumio Plugin menu. Now I'm getting an error 0 in the logs, which might imply that the account was disabled due to too many playlist queries. That's what it says in the Unofficial Pandora API documentation (what I use for the back end).

I thought it had something to do with my personal Pandora account, or possibly my IP address since I've been doing a lot of testing. I verified that I can log in to the Pandora website so that does not seem to be the case. I also tried another account and it didn't work, as well as running the Raspberry Pi through a VPN.

You can see that the login is successful if you follow the log:

journalctl -f

I think what is happening is that Pandora is logging us out as soon as the plugin fetches the list of stations. The plugin stops before a playlist is downloaded. That doesn't happen until you choose a station in the UI.

I tried using the v1.0.0 version this afternoon and the same thing happened, and I know that it was working fine before. You can do so as well by following the instructions in the Readme.md to manually install that version.

What might work is to change the login credentials from the default Android to some other device. There are a few other options in the API. But actually, I'm not sure that would work. I'll give it a shot tomorrow and post my results here.

Perhaps this is a temporary thing? Maybe the best thing to do is just try it again tomorrow. It's not what I want to recommend; it's just that I'm not sure what's going on.

I haven't made any real changes to the way the plugin interacts with Pandora in a while. A guy on the forum was testing it with me all through this and he didn't see any issues like this. This all began maybe 6 hours ago.

truckershitch commented 4 years ago

I went to the page I first tried anesidora on. You can test sample code there. There is a snippet that grabs a station list and shows you it's working. You just have to change "email" and "password" to your credentials and click Run.

https://npm.runkit.com/anesidora

It threw an error. The same error you see in my logs.

Error: An unexpected error occurred [0]

I think it's an anesidora problem. Or my account is temporarily restricted. I am not sure yet.

hemlockpa commented 4 years ago

I will try some of your suggestions tomorrow morning. I currently have a Pi running VOlumio 2.779 (6/8/2020) with Pandora plugin 1.0.0 that is still responding properly. With the 2.3.0 and newer volumio I can see no sign that the Pandora login is failing - I see a screen message that the login to Pandora was successful when I supply the settings, but, since I have no icon to attempt to start a Pandora connection, I can not test for a valid connection. When I track journaling while enabling the Pandora plugin, I see these messages Aug 07 00:05:02 volumioporch volumio[1054]: info: Enabling plugin pandora Aug 07 00:05:02 volumioporch volumio[1054]: info: Loading plugin "pandora"... Aug 07 00:05:02 volumioporch volumio[1054]: info: Applying required configuration parameters for plugin pandora Aug 07 00:05:02 volumioporch volumio[1054]: info: PLUGIN START: pandora Aug 07 00:05:02 volumioporch volumio[1054]: info: [1596758702505] ControllerPandora::checkConfValidity Aug 07 00:05:02 volumioporch volumio[1054]: info: [1596758702505] ControllerPandora::initialSetup Aug 07 00:05:02 volumioporch volumio[1054]: info: [1596758702506] ControllerPandora::PandoraHandler::init Aug 07 00:05:02 volumioporch volumio[1054]: info: [1596758702507] ControllerPandora::PandoraHandler::pandoraLoginAndGetStations Aug 07 00:05:03 volumioporch volumio[1054]: info: [1596758703367] [Pandora] Logged in Aug 07 00:05:03 volumioporch volumio[1054]: info: [1596758703877] ControllerPandora::PandoraHandler::fillStationData Aug 07 00:05:03 volumioporch volumio[1054]: info: [1596758703878] ControllerPandora::flushPandora Aug 07 00:05:03 volumioporch volumio[1054]: info: CoreStateMachine::getQueue Aug 07 00:05:03 volumioporch volumio[1054]: info: CorePlayQueue::getQueue Aug 07 00:05:03 volumioporch volumio[1054]: info: CorePlayQueue::clearAddPlayQueue Aug 07 00:05:03 volumioporch volumio[1054]: info: CorePlayQueue::saveQueue Aug 07 00:05:03 volumioporch volumio[1054]: info: CoreCommandRouter::serviceClearAddPlayTracks Aug 07 00:05:03 volumioporch volumio[1054]: error: WARNING: No clearAddPlayTracks method for service webradio Aug 07 00:05:03 volumioporch volumio[1054]: info: CoreCommandRouter::volumioPushQueue Aug 07 00:05:03 volumioporch volumio[1054]: info: CoreCommandRouter::volumioAddToBrowseSources[object Object] Aug 07 00:05:03 volumioporch volumio[1054]: info: [1596758703887] CoreMusicLibrary::Adding element Pandora Radio Aug 07 00:05:03 volumioporch volumio[1054]: info: CoreCommandRouter::executeOnPlugin: my_music , getDisabledSources Aug 07 00:05:03 volumioporch volumio[1054]: info: Done.

On Thu, Aug 6, 2020 at 6:52 PM truckershitch notifications@github.com wrote:

I went to the page I first tried anesidora on. You can test sample code there. There is a snippet that grabs a station list and shows you it's working. You just have to change "email" and "password" to your credentials and click Run.

https://npm.runkit.com/anesidora

It threw an error. The same error you see in my logs.

Error: An unexpected error occurred [0]

I think it's an anesidora problem. Or my account is temporarily restricted. I am not sure yet.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/truckershitch/volumio-plugins/issues/3#issuecomment-670229626, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJUQQ5RS6X3OSIQTFYQM4H3R7MX3RANCNFSM4PXAKZFQ .

-- Gary Hatt (570) 213-1982

Life should come with a pwd command

hemlockpa commented 4 years ago

Just deleted, rebooted and reinstalled Pandora plugin 2.3.0 on the 2.806 Volumio and found the Pandora icon in the Web Radio entries with populated playlists. Looks like the 8th time is a success.

On Thu, Aug 6, 2020 at 8:08 PM Gary Hatt gah0815@gmail.com wrote:

I will try some of your suggestions tomorrow morning. I currently have a Pi running VOlumio 2.779 (6/8/2020) with Pandora plugin 1.0.0 that is still responding properly. With the 2.3.0 and newer volumio I can see no sign that the Pandora login is failing - I see a screen message that the login to Pandora was successful when I supply the settings, but, since I have no icon to attempt to start a Pandora connection, I can not test for a valid connection. When I track journaling while enabling the Pandora plugin, I see these messages Aug 07 00:05:02 volumioporch volumio[1054]: info: Enabling plugin pandora Aug 07 00:05:02 volumioporch volumio[1054]: info: Loading plugin "pandora"... Aug 07 00:05:02 volumioporch volumio[1054]: info: Applying required configuration parameters for plugin pandora Aug 07 00:05:02 volumioporch volumio[1054]: info: PLUGIN START: pandora Aug 07 00:05:02 volumioporch volumio[1054]: info: [1596758702505] ControllerPandora::checkConfValidity Aug 07 00:05:02 volumioporch volumio[1054]: info: [1596758702505] ControllerPandora::initialSetup Aug 07 00:05:02 volumioporch volumio[1054]: info: [1596758702506] ControllerPandora::PandoraHandler::init Aug 07 00:05:02 volumioporch volumio[1054]: info: [1596758702507] ControllerPandora::PandoraHandler::pandoraLoginAndGetStations Aug 07 00:05:03 volumioporch volumio[1054]: info: [1596758703367] [Pandora] Logged in Aug 07 00:05:03 volumioporch volumio[1054]: info: [1596758703877] ControllerPandora::PandoraHandler::fillStationData Aug 07 00:05:03 volumioporch volumio[1054]: info: [1596758703878] ControllerPandora::flushPandora Aug 07 00:05:03 volumioporch volumio[1054]: info: CoreStateMachine::getQueue Aug 07 00:05:03 volumioporch volumio[1054]: info: CorePlayQueue::getQueue Aug 07 00:05:03 volumioporch volumio[1054]: info: CorePlayQueue::clearAddPlayQueue Aug 07 00:05:03 volumioporch volumio[1054]: info: CorePlayQueue::saveQueue Aug 07 00:05:03 volumioporch volumio[1054]: info: CoreCommandRouter::serviceClearAddPlayTracks Aug 07 00:05:03 volumioporch volumio[1054]: error: WARNING: No clearAddPlayTracks method for service webradio Aug 07 00:05:03 volumioporch volumio[1054]: info: CoreCommandRouter::volumioPushQueue Aug 07 00:05:03 volumioporch volumio[1054]: info: CoreCommandRouter::volumioAddToBrowseSources[object Object] Aug 07 00:05:03 volumioporch volumio[1054]: info: [1596758703887] CoreMusicLibrary::Adding element Pandora Radio Aug 07 00:05:03 volumioporch volumio[1054]: info: CoreCommandRouter::executeOnPlugin: my_music , getDisabledSources Aug 07 00:05:03 volumioporch volumio[1054]: info: Done.

On Thu, Aug 6, 2020 at 6:52 PM truckershitch notifications@github.com wrote:

I went to the page I first tried anesidora on. You can test sample code there. There is a snippet that grabs a station list and shows you it's working. You just have to change "email" and "password" to your credentials and click Run.

https://npm.runkit.com/anesidora

It threw an error. The same error you see in my logs.

Error: An unexpected error occurred [0]

I think it's an anesidora problem. Or my account is temporarily restricted. I am not sure yet.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/truckershitch/volumio-plugins/issues/3#issuecomment-670229626, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJUQQ5RS6X3OSIQTFYQM4H3R7MX3RANCNFSM4PXAKZFQ .

-- Gary Hatt (570) 213-1982

Life should come with a pwd command

-- Gary Hatt (570) 213-1982

Life should come with a pwd command

truckershitch commented 4 years ago

Likewise on my side, but the login and station list loading took about 20 seconds. So that's a little weird.

Thanks for the update! I did see that the plugin was failing with the request module. I learned tonight that that module is being phased out. I'm looking into updating my fork of anesidora with another module, maybe cross-fetch. But I don't know if that is necessary at this point.

So who knows what the problem is. I can update the anesidora code anyway just to change it from callbacks to Promises with kew.

Keep testing and see what you find out. I encourage you for now to try the new index.js found here which will be in v2.3.1. It hopefully fixes a premature track expiration error.

You can do this for now:

Grab the index.js from here (you can just copy and paste it from raw mode into a new file (make sure it doesn't have Windows line endings). Put the new index.js file in /data/plugins/music_service/pandora

Or, clone the repo as I wrote in the Readme.md, then:

cd /path/to/volumio-plugins/plugins/music_service/pandora volumio plugin upgrade

It will stop at 100% for some reason but it should work.

The pertinent files reside in /data/configuration/music_service/pandora and /data/plugins/music_service/pandora