[PLUGIN] Pandora Plugin 2.0

Hi Glenn :slight_smile:

Last summer, I did a lot of development over a short period of time. Along the way, there were several bugs and improvements introduced. I hope that most of them have been addressed, however there are a few more that I have to work on.

One of them was mentioned by @downtownHippie and I’m not sure how to address that at the moment. Another one that I know of is that the first tracks grabbed are duplicated when the program starts. I just haven’t had a chance to dive into that second bug yet.

I believe that version 2.9.2 is the most current – that’s what I have here locally. Can you give that version a try? You should be able to update to it from the main Volumio menu. Failing that, you can just grab the source from my GitHub repo.

What you are doing looks interesting. Please fill us all in on your progress!

Sorry 2.0.9 was a typo, I am running the latest version 2.9.2.

I also use the Spotify Plugin 2.0.3 version and it is working fine with the same SocketIO call to load the Json file that is returned by the same “browse” function. I also changed the socket call to replaceAndPlay:

image

sio.emit(“replaceAndPlay”,{“service”:“spop”,“type”:“playlist”,“title”:“Electronic Pop”,“albumart”:“https://mosaic.scdn.co/640/ab67616d0000b2731a104e8630a97b573201f655ab67616d0000b2738863bc11d2aa12b54f5aeb36ab67616d0000b273aae542061ac42ee04779fb2fab67616d0000b273be969b70f5ad29a3ba54d8ee",“uri”:"spotify:user:spotify:playlist:4KzBvM3Ux7tdwT6voutjZH”})

HTH
Glenn

@GlennBurnett Take a look at this output from the plugin:

Oct 12 16:50:43 volumio volumio[970]: info: [1634071843533] ControllerPandora::PandoraHandler::fetchTracks::fetchStationPlaylist
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::volumioGetState
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getTrack 0
Oct 12 16:50:44 volumio volumio[970]: info: Listing playlists
Oct 12 16:50:44 volumio volumio[970]: info: Listing playlists
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844578] [Pandora] PandoraHandler::fetchTracks::fetchStationPlaylist: Retrieved Tool playlist
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844580] ControllerPandora::PandoraHandler::fetchTracks::fillNewTracks
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844582] [Pandora] PandoraHandler::fetchTracks::fillNewTracks: Fetched 4 track(s)
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::addQueueItems
Oct 12 16:50:44 volumio volumio[970]: info: Adding Item to queue: /pandora/stationToken=2614581235804285591trackId=5698634996614699141
Oct 12 16:50:44 volumio volumio[970]: info: Exploding uri /pandora/stationToken=2614581235804285591trackId=5698634996614699141 in service pandora
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844586] ControllerPandora::explodeUri
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: Adding Item to queue: /pandora/stationToken=2614581235804285591trackId=7172386784749455536
Oct 12 16:50:44 volumio volumio[970]: info: Exploding uri /pandora/stationToken=2614581235804285591trackId=7172386784749455536 in service pandora
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844587] ControllerPandora::explodeUri
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: Adding Item to queue: /pandora/stationToken=2614581235804285591trackId=1076112715076876425
Oct 12 16:50:44 volumio volumio[970]: info: Exploding uri /pandora/stationToken=2614581235804285591trackId=1076112715076876425 in service pandora
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844588] ControllerPandora::explodeUri
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: Adding Item to queue: /pandora/stationToken=2614581235804285591trackId=615023797295767538
Oct 12 16:50:44 volumio volumio[970]: info: Exploding uri /pandora/stationToken=2614581235804285591trackId=615023797295767538 in service pandora
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844589] ControllerPandora::explodeUri
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::saveQueue
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::volumioPushQueue
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::updateTrackBlock
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getTrackBlock
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::play index 0
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::stop
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 16:50:44 volumio volumio[970]: UNSET VOLATILE
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::play index undefined
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getTrack 0
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::startPlaybackTimer
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getTrack 0
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844613] ControllerPandora::clearAddPlayTrack
Oct 12 16:50:44 volumio volumio[970]: info: ControllerMpd::clear
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::sendMpdCommand clear
Oct 12 16:50:44 volumio volumio[970]: info:
Oct 12 16:50:44 volumio volumio[970]: ---------------------------- MPD announces system playlist update
Oct 12 16:50:44 volumio volumio[970]: info: Ignoring MPD Status Update
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844628] ControllerPandora::checkForExpiredStations
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844630] ControllerPandora::removeTrack
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844630] [Pandora] removeTrack: Not removing track with uri: null at queue index: -1
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844631] [Pandora] MQTTHandler::publishData: Published stationName to mqtt://192.168.1.50:1883 topic: volumio/pandora/stationName
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844632] ControllerPandora::appendTracksToMpd
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844633] [Pandora] appendTracksToMpd: Added 1 track(s) to mpd
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::sendMpdCommand addid
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::sendMpdCommand play
Oct 12 16:50:44 volumio volumio[970]: error: updateQueue error: null
Oct 12 16:50:44 volumio volumio[970]: info:
Oct 12 16:50:44 volumio volumio[970]: ---------------------------- MPD announces system playlist update
Oct 12 16:50:44 volumio volumio[970]: info: Ignoring MPD Status Update
Oct 12 16:50:44 volumio volumio[970]: info: ------------------------------ 29ms
Oct 12 16:50:44 volumio volumio[970]: verbose: MPD COMMAND [object Object]
Oct 12 16:50:44 volumio volumio[970]: verbose: MPD COMMAND [object Object]
Oct 12 16:50:44 volumio volumio[970]: verbose: MPD COMMAND [object Object]
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844657] ControllerPandora::pushState
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::servicePushState
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getTrack 0
Oct 12 16:50:44 volumio volumio[970]: verbose: STATE SERVICE {"service":"pandora","type":"song","trackType":"mp3","title":"Vicarious","name":"Vicarious","artist":"TOOL","album":"10,000 Days (Explicit)","albumart":"http://mediaserver-cont-usc-mp1-1-v4v6.pandora.com/images/d7/1c/d0/03/90ad4c318d7aed0c6c908cdd/1080W_1080H.jpg","realUri":"http://t1-5.p-cdn.us/access/5698634996614699141.mp3?version=5&lid=75770519&token=uhNcISNHWDNLy2haT3Raai%2Fqcr%2F7HaWgjrwGI67LauwHOraakhIlR5UhG1GGfbcXimYKioCZqRkaKcGq3hWinc%2Bi%2Bl3GF4U7duU5kdbdJLtXxXacuWYH5VBpNxSEyCmZu1Bz0fgato6aOBjfdgPtVdd%2Bx2EhOz9r35GVkOtCokrGzUu7mceZVMNnM5ZSWC%2F8Z1UmDhifpdNHVUokyd4b1gYt8zVGdK%2B8ApGnt8U8DonzPsRult0wMbTuyigOv5aOgYwhfWRfSOM7kx4%2FHsyPnDzdqgAt0a6mPIsgxE2Tfoh%2FvDzDm%2FsovKl1%2F43bpApufC%2FeIfsf7%2Bqg5EixLsEyzQ%3D%3D","isStreaming":true,"duration":426,"samplerate":"44.1 KHz","bitdepth":"16 bit","channels":2,"uri":"http://t1-5.p-cdn.us/access/5698634996614699141.mp3?version=5&lid=75770519&token=uhNcISNHWDNLy2haT3Raai%2Fqcr%2F7HaWgjrwGI67LauwHOraakhIlR5UhG1GGfbcXimYKioCZqRkaKcGq3hWinc%2Bi%2Bl3GF4U7duU5kdbdJLtXxXacuWYH5VBpNxSEyCmZu1Bz0fgato6aOBjfdgPtVdd%2Bx2EhOz9r35GVkOtCokrGzUu7mceZVMNnM5ZSWC%2F8Z1UmDhifpdNHVUokyd4b1gYt8zVGdK%2B8ApGnt8U8DonzPsRult0wMbTuyigOv5aOgYwhfWRfSOM7kx4%2FHsyPnDzdqgAt0a6mPIsgxE2Tfoh%2FvDzDm%2FsovKl1%2F43bpApufC%2FeIfsf7%2Bqg5EixLsEyzQ%3D%3D","seek":0,"status":"play"}
Oct 12 16:50:44 volumio volumio[970]: verbose: CURRENT POSITION 0
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::syncState   stateService play
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::syncState   currentStatus stop
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::pushState
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getTrack 0
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::volumioPushState
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::setConsumeUpdateService pandora
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844673] ControllerPandora::fetchAndAddTracks
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844674] ControllerPandora::getStationTracks
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844676] [Pandora] PandoraHandler::getSongMaxDiff: -12
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844677] ControllerPandora::fetchAndAddTracks::getSqInfo
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844677] ControllerPandora::getStationTracks
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844680] [Pandora] fetchAndAddTracks: diff1: -12 sQPos1: 0
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844680] [Pandora] fetchAndAddTracks: Fetching tracks
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844681] ControllerPandora::PandoraHandler::fillStationData
Oct 12 16:50:44 volumio volumio[970]: error: Upnp client error: Error: This socket has been ended by the other party
Oct 12 16:50:44 volumio volumio[970]: info:
Oct 12 16:50:44 volumio volumio[970]: ---------------------------- MPD announces system playlist update
Oct 12 16:50:44 volumio volumio[970]: info: Ignoring MPD Status Update
Oct 12 16:50:44 volumio volumio[970]: info: ------------------------------ 42ms
Oct 12 16:50:44 volumio volumio[970]: info: ------------------------------ 5ms
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844887] ControllerPandora::pandoraListener
Oct 12 16:50:44 volumio volumio[970]: info: ControllerMpd::getState
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::sendMpdCommand status
Oct 12 16:50:44 volumio volumio[970]: info:
Oct 12 16:50:44 volumio volumio[970]: ---------------------------- MPD announces state update: player
Oct 12 16:50:44 volumio volumio[970]: info: ControllerMpd::getState
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::sendMpdCommand status
Oct 12 16:50:44 volumio volumio[970]: info:
Oct 12 16:50:44 volumio volumio[970]: ---------------------------- MPD announces state update: player
Oct 12 16:50:44 volumio volumio[970]: info: ControllerMpd::getState
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::sendMpdCommand status
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::parseState
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::sendMpdCommand playlistinfo
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::parseState
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::sendMpdCommand playlistinfo
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::parseState
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::sendMpdCommand playlistinfo
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::parseTrackInfo
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getTrack 0
Oct 12 16:50:44 volumio volumio[970]: info: [1634071844921] ControllerPandora::pushState
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::servicePushState
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getTrack 0
Oct 12 16:50:44 volumio volumio[970]: verbose: STATE SERVICE {"status":"play","position":0,"seek":0,"duration":427,"samplerate":"44.1 KHz","bitdepth":"16 bit","channels":2,"random":false,"updatedb":false,"repeat":false,"bitrate":null,"isStreaming":false,"title":"Vicarious","artist":"TOOL","album":"10,000 Days (Explicit)","uri":"http://t1-5.p-cdn.us/access/5698634996614699141.mp3?version=5&lid=75770519&token=uhNcISNHWDNLy2haT3Raai%2Fqcr%2F7HaWgjrwGI67LauwHOraakhIlR5UhG1GGfbcXimYKioCZqRkaKcGq3hWinc%2Bi%2Bl3GF4U7duU5kdbdJLtXxXacuWYH5VBpNxSEyCmZu1Bz0fgato6aOBjfdgPtVdd%2Bx2EhOz9r35GVkOtCokrGzUu7mceZVMNnM5ZSWC%2F8Z1UmDhifpdNHVUokyd4b1gYt8zVGdK%2B8ApGnt8U8DonzPsRult0wMbTuyigOv5aOgYwhfWRfSOM7kx4%2FHsyPnDzdqgAt0a6mPIsgxE2Tfoh%2FvDzDm%2FsovKl1%2F43bpApufC%2FeIfsf7%2Bqg5EixLsEyzQ%3D%3D","trackType":"mp3"}
Oct 12 16:50:44 volumio volumio[970]: verbose: CURRENT POSITION 0
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::syncState   stateService play
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::syncState   currentStatus play
Oct 12 16:50:44 volumio volumio[970]: info: Received an update from plugin. extracting info from payload
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::pushState
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::volumioPushState
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::pushState
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::volumioPushState
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::setConsumeUpdateService pandora
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::parseTrackInfo
Oct 12 16:50:44 volumio volumio[970]: verbose: ControllerMpd::parseTrackInfo
Oct 12 16:50:44 volumio volumio[970]: info: ControllerMpd::pushState
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::servicePushState
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getTrack 0
Oct 12 16:50:44 volumio volumio[970]: info: CONSUME SERVICE: Received update from a service different from the one supposed to be playing music. Skipping notification. Current pandora Received mpd
Oct 12 16:50:44 volumio volumio[970]: info: ControllerMpd::pushState
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::servicePushState
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getTrack 0
Oct 12 16:50:44 volumio volumio[970]: info: CONSUME SERVICE: Received update from a service different from the one supposed to be playing music. Skipping notification. Current pandora Received mpd
Oct 12 16:50:44 volumio volumio[970]: info: ------------------------------ 51ms
Oct 12 16:50:44 volumio volumio[970]: info: ------------------------------ 35ms
Oct 12 16:50:44 volumio volumio[970]: info: CoreCommandRouter::volumioGetQueue
Oct 12 16:50:44 volumio volumio[970]: info: CoreStateMachine::getQueue
Oct 12 16:50:44 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:45 volumio volumio[970]: info: [1634071845087] ControllerPandora::PandoraHandler::publishStationData
Oct 12 16:50:45 volumio volumio[970]: info: [1634071845089] [Pandora] MQTTHandler::publishData: Published stationData to mqtt://192.168.1.50:1883 topic: volumio/pandora/stationData
Oct 12 16:50:45 volumio volumio[970]: info: [1634071845090] ControllerPandora::PandoraHandler::fetchTracks::fetchStationPlaylist
Oct 12 16:50:45 volumio volumio[970]: info: [1634071845835] [Pandora] PandoraHandler::fetchTracks::fetchStationPlaylist: Retrieved Tool playlist
Oct 12 16:50:45 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:45 volumio volumio[970]: info: [1634071845836] ControllerPandora::PandoraHandler::fetchTracks::fillNewTracks
Oct 12 16:50:45 volumio volumio[970]: info: [1634071845837] [Pandora] PandoraHandler::fetchTracks::fillNewTracks: Fetched 4 track(s)
Oct 12 16:50:45 volumio volumio[970]: info: CorePlayQueue::addQueueItems
Oct 12 16:50:45 volumio volumio[970]: info: Adding Item to queue: /pandora/stationToken=2614581235804285591trackId=5144226752569024224
Oct 12 16:50:45 volumio volumio[970]: info: Exploding uri /pandora/stationToken=2614581235804285591trackId=5144226752569024224 in service pandora
Oct 12 16:50:45 volumio volumio[970]: info: [1634071845840] ControllerPandora::explodeUri
Oct 12 16:50:45 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:45 volumio volumio[970]: info: Adding Item to queue: /pandora/stationToken=2614581235804285591trackId=7621890671420772159
Oct 12 16:50:45 volumio volumio[970]: info: Exploding uri /pandora/stationToken=2614581235804285591trackId=7621890671420772159 in service pandora
Oct 12 16:50:45 volumio volumio[970]: info: [1634071845841] ControllerPandora::explodeUri
Oct 12 16:50:45 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:45 volumio volumio[970]: info: Adding Item to queue: /pandora/stationToken=2614581235804285591trackId=673488620818230663
Oct 12 16:50:45 volumio volumio[970]: info: Exploding uri /pandora/stationToken=2614581235804285591trackId=673488620818230663 in service pandora
Oct 12 16:50:45 volumio volumio[970]: info: [1634071845843] ControllerPandora::explodeUri
Oct 12 16:50:45 volumio volumio[970]: info: CorePlayQueue::getQueue
Oct 12 16:50:45 volumio volumio[970]: info: Adding Item to queue: /pandora/stationToken=2614581235804285591trackId=1363981088989761575
Oct 12 16:50:45 volumio volumio[970]: info: Exploding uri /pandora/stationToken=2614581235804285591trackId=1363981088989761575 in service pandora
Oct 12 16:50:45 volumio volumio[970]: info: [1634071845845] ControllerPandora::explodeUri

My memory of this is hazy, but as the output shows, individual station tracks are added to the queue, not pandora stations. The plugin fetches the tracks as needed.

Try adding stations this way:

/pandora/stationToken=23

From common.js:

handleBrowseUri is looking for this regular expression match (imported as uriStaRE – short for uri Station RegEx).

/\/pandora\/stationToken=(\d+)/

That number should correspond to the station’s numerical position in the array / list / whatever you call it :slight_smile:

Good luck and please report back!

I am passing the station token that I get back from the browse API. I tried to replace it with the numerical value of the position in the list, but that did not work either.

In both journalctl logs you see it attempts to explode the URI, but from the API call it seems unsuccessful, from the UI it is working.

Let me know if I can provide any more information.

Thanks!!

Here is the browse results from the API: http://volumiodev:3000/api/V1/browse?uri=/pandora

{"navigation":{"prev":{"uri":"/pandora"},"lists":[{"availableListViews":["list"],"items":[
{"service":"pandora","type":"station","title":"Puscifer Radio","name":"Puscifer Radio","albumart":"https://content-images.p-cdn.com/images/a9/33/69/c2/5cb84edcaecf90076ba3c034/_500W_500H.jpg","icon":"fa fa-folder-open-o","uri":"/pandora/stationToken=3583959267178674503"}

Here is my Python code:

def playPandora2():
    service = "Pandora2"
    
    sio = SocketIO('localhost', 3000)
    sio.emit("clearQueue", "")
    #sio.emit("replaceAndPlay",{"service":"pandora","type":"station","artist":"","title":"Polo G Radio","name":"Polo G Radio","album":"","albumart":"https://content-images.p-cdn.com/images/e8/0d/e7/9a/54b147d2b2282c7d5b4081ad/_500W_500H.jpg","icon":"fa fa-folder-open-o","uri":"/pandora/station_id=1"})
    sio.emit("replaceAndPlay",{"service":"pandora","type":"station","title":"Puscifer Radio","name":"Puscifer Radio","albumart":"https://content-images.p-cdn.com/images/a9/33/69/c2/5cb84edcaecf90076ba3c034/_500W_500H.jpg","icon":"fa fa-folder-open-o","uri":"/pandora/stationToken=3583959267178674503"})
    
    sio.disconnect()
    return service

Here is loading the above stationToken from the Volumio UI journalctl:

Logs begin at Tue 2021-10-12 02:33:01 MST. --
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::getTrack 0
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::getTrack 0
Oct 12 15:39:56 volumiodev python3[11783]: 192.168.4.27 - - [12/Oct/2021 15:39:56] "GET /favicon.ico HTTP/1.1" 404 -
Oct 12 15:41:20 volumiodev smbd[23580]: [2021/10/12 15:41:20.085559,  0] ../lib/util/debug.c:603(reopen_logs_internal)
Oct 12 15:41:20 volumiodev smbd[23580]: Unable to open new log file '/var/log/samba/log.smbd': No such file or directory
Oct 12 15:41:58 volumiodev volumio[1255]: error: error
Oct 12 15:42:30 volumiodev smbd[5567]: [2021/10/12 15:42:30.121777,  0] ../lib/util/debug.c:603(reopen_logs_internal)
Oct 12 15:42:30 volumiodev smbd[5567]: Unable to open new log file '/var/log/samba/log.smbd': No such file or directory
Oct 12 15:42:48 volumiodev volumio[1255]: error: error
Oct 12 15:44:01 volumiodev volumio[1255]: info: CoreCommandRouter::executeOnPlugin: pandora , handleBrowseUri
Oct 12 15:44:01 volumiodev volumio[1255]: info: [1634078641856] ControllerPandora::handleBrowseUri
Oct 12 15:44:01 volumiodev volumio[1255]: info: [1634078641856] ControllerPandora::checkForExpiredStations
Oct 12 15:44:01 volumiodev volumio[1255]: info: [1634078641857] [Pandora] checkForExpiredStations: Stations expired
Oct 12 15:44:01 volumiodev volumio[1255]: info: [1634078641857] ControllerPandora::PandoraHandler::fillStationData
Oct 12 15:44:05 volumiodev volumio[1255]: info: [1634078645463] ControllerPandora::PandoraHandler::fillStationData
Oct 12 15:44:05 volumiodev volumio[1255]: info: [1634078645789] ControllerPandora::PandoraHandler::fetchTracks::fetchStationPlaylist
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646329] [Pandora] PandoraHandler::fetchTracks::fetchStationPlaylist: Retrieved Puscifer Radio playlist
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646329] ControllerPandora::PandoraHandler::fetchTracks::fillNewTracks
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646330] [Pandora] PandoraHandler::fetchTracks::fillNewTracks: Fetched 4 track(s)
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::addQueueItems
Oct 12 15:44:06 volumiodev volumio[1255]: info: Adding Item to queue: /pandora/stationToken=3583959267178674503trackId=1484830872071778748
Oct 12 15:44:06 volumiodev volumio[1255]: info: Exploding uri /pandora/stationToken=3583959267178674503trackId=1484830872071778748 in service pandora
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646331] ControllerPandora::explodeUri
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: Adding Item to queue: /pandora/stationToken=3583959267178674503trackId=6437276833028140361
Oct 12 15:44:06 volumiodev volumio[1255]: info: Exploding uri /pandora/stationToken=3583959267178674503trackId=6437276833028140361 in service pandora
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646332] ControllerPandora::explodeUri
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: Adding Item to queue: /pandora/stationToken=3583959267178674503trackId=6282539889401606192
Oct 12 15:44:06 volumiodev volumio[1255]: info: Exploding uri /pandora/stationToken=3583959267178674503trackId=6282539889401606192 in service pandora
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646333] ControllerPandora::explodeUri
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: Adding Item to queue: /pandora/stationToken=3583959267178674503trackId=2008636039658067951
Oct 12 15:44:06 volumiodev volumio[1255]: info: Exploding uri /pandora/stationToken=3583959267178674503trackId=2008636039658067951 in service pandora
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646334] ControllerPandora::explodeUri
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::saveQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::updateTrackBlock
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getTrackBlock
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::play index 0
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::stop
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: UNSET VOLATILE
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::play index undefined
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getTrack 0
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::startPlaybackTimer
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getTrack 0
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646351] ControllerPandora::clearAddPlayTrack
Oct 12 15:44:06 volumiodev volumio[1255]: info: ControllerMpd::clear
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::sendMpdCommand clear
Oct 12 15:44:06 volumiodev volumio[1255]: info:
Oct 12 15:44:06 volumiodev volumio[1255]: ---------------------------- MPD announces system playlist update
Oct 12 15:44:06 volumiodev volumio[1255]: info: Ignoring MPD Status Update
Oct 12 15:44:06 volumiodev volumio[1255]: info: sendMpdCommand clear took 7 milliseconds
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646360] ControllerPandora::checkForExpiredStations
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646360] ControllerPandora::removeTrack
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646361] [Pandora] removeTrack: Not removing track with uri: null at queue index: -1
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646361] ControllerPandora::appendTracksToMpd
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646361] [Pandora] appendTracksToMpd: Added 1 track(s) to mpd
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::sendMpdCommand addid
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::sendMpdCommand play
Oct 12 15:44:06 volumiodev volumio[1255]: error: updateQueue error: null
Oct 12 15:44:06 volumiodev volumio[1255]: info:
Oct 12 15:44:06 volumiodev volumio[1255]: ---------------------------- MPD announces system playlist update
Oct 12 15:44:06 volumiodev volumio[1255]: info: Ignoring MPD Status Update
Oct 12 15:44:06 volumiodev volumio[1255]: info: ------------------------------ 14ms
Oct 12 15:44:06 volumiodev volumio[1255]: info: sendMpdCommand addid took 10 milliseconds
Oct 12 15:44:06 volumiodev volumio[1255]: info: sendMpdCommand play took 9 milliseconds
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: MPD COMMAND [object Object]
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: MPD COMMAND [object Object]
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: MPD COMMAND [object Object]
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646375] ControllerPandora::pushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreCommandRouter::servicePushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getTrack 0
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: STATE SERVICE {"service":"pandora","type":"song","trackType":"mp3","title":"The Mission (M Is For Milla Mix)","name":"The Mission (M Is For Milla Mix)","artist":"Puscifer","album":"Sound Into Blood Into Wine","albumart":"http://mediaserver-cont-usc-mp1-2-v4v6.pandora.com/images/66/1b/37/e1/11dc40a5870a2c2ca9e76975/1080W_1080H.jpg","realUri":"http://t1-4.p-cdn.us/access/1484830872071778748.mp3?version=5&lid=27752775&token=pNehErphfUgrjGEPodoD8QJ2UoRy17ZdBQaj1WUSdqX3j9EgDfft042%2FWQFoTP9oO4z9zAGMoagc8h8d014ByBmm8db5%2BDBXQcjHB550zjnVW8EQbZ%2B%2FFcooAVWKvWTY%2BQunElYYeQdlUVdp6TDdEHVNnYgbp%2B8mtbRoOs7FSinX7Kyb7Qb%2FDfyOHVA9JDrmdJ%2BKharvLmVxd%2BvxxW8Y6USTh8JN4JU0jJQ%2FdzHc2nEbT170VcvAFs3ivyQ3oeimrCUxdCeRLlhmczFsnG5NoLeznYEs225II9D6B2rXjuRyzGmKcOP1na32kJZRn1Y7taN%2B90jKhBR2U9DKmW9ncg%3D%3D","isStreaming":true,"duration":224,"samplerate":"44.1 KHz","bitdepth":"16 bit","channels":2,"uri":"http://t1-4.p-cdn.us/access/1484830872071778748.mp3?version=5&lid=27752775&token=pNehErphfUgrjGEPodoD8QJ2UoRy17ZdBQaj1WUSdqX3j9EgDfft042%2FWQFoTP9oO4z9zAGMoagc8h8d014ByBmm8db5%2BDBXQcjHB550zjnVW8EQbZ%2B%2FFcooAVWKvWTY%2BQunElYYeQdlUVdp6TDdEHVNnYgbp%2B8mtbRoOs7FSinX7Kyb7Qb%2FDfyOHVA9JDrmdJ%2BKharvLmVxd%2BvxxW8Y6USTh8JN4JU0jJQ%2FdzHc2nEbT170VcvAFs3ivyQ3oeimrCUxdCeRLlhmczFsnG5NoLeznYEs225II9D6B2rXjuRyzGmKcOP1na32kJZRn1Y7taN%2B90jKhBR2U9DKmW9ncg%3D%3D","seek":0,"status":"play"}
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: CURRENT POSITION 0
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::syncState   stateService play
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::syncState   currentStatus stop
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::pushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getTrack 0
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService pandora
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646384] ControllerPandora::fetchAndAddTracks
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646385] ControllerPandora::getStationTracks
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646385] [Pandora] PandoraHandler::getSongMaxDiff: -12
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646386] ControllerPandora::fetchAndAddTracks::getSqInfo
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646387] ControllerPandora::getStationTracks
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646388] [Pandora] fetchAndAddTracks: diff1: -12 sQPos1: 0
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646388] [Pandora] fetchAndAddTracks: Fetching tracks
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646388] ControllerPandora::PandoraHandler::fillStationData
Oct 12 15:44:06 volumiodev volumio[1255]: info:
Oct 12 15:44:06 volumiodev volumio[1255]: ---------------------------- MPD announces system playlist update
Oct 12 15:44:06 volumiodev volumio[1255]: info: Ignoring MPD Status Update
Oct 12 15:44:06 volumiodev volumio[1255]: info: ------------------------------ 28ms
Oct 12 15:44:06 volumiodev volumio[1255]: info: ------------------------------ 17ms
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646526] ControllerPandora::pandoraListener
Oct 12 15:44:06 volumiodev volumio[1255]: info: ControllerMpd::getState
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::sendMpdCommand status
Oct 12 15:44:06 volumiodev volumio[1255]: info:
Oct 12 15:44:06 volumiodev volumio[1255]: ---------------------------- MPD announces state update: player
Oct 12 15:44:06 volumiodev volumio[1255]: info: ControllerMpd::getState
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::sendMpdCommand status
Oct 12 15:44:06 volumiodev volumio[1255]: info:
Oct 12 15:44:06 volumiodev volumio[1255]: ---------------------------- MPD announces state update: player
Oct 12 15:44:06 volumiodev volumio[1255]: info: sendMpdCommand status took 3 milliseconds
Oct 12 15:44:06 volumiodev volumio[1255]: info: ControllerMpd::getState
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::sendMpdCommand status
Oct 12 15:44:06 volumiodev volumio[1255]: info: sendMpdCommand status took 3 milliseconds
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::parseState
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::sendMpdCommand playlistinfo
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::parseState
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::sendMpdCommand playlistinfo
Oct 12 15:44:06 volumiodev volumio[1255]: info: sendMpdCommand status took 5 milliseconds
Oct 12 15:44:06 volumiodev volumio[1255]: info: sendMpdCommand playlistinfo took 4 milliseconds
Oct 12 15:44:06 volumiodev volumio[1255]: info: sendMpdCommand playlistinfo took 3 milliseconds
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::parseState
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::sendMpdCommand playlistinfo
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::parseTrackInfo
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::parseTrackInfo
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getTrack 0
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646541] ControllerPandora::pushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreCommandRouter::servicePushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getTrack 0
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: STATE SERVICE {"status":"play","position":0,"seek":116,"duration":224,"samplerate":"44.1 KHz","bitdepth":"16 bit","channels":2,"random":false,"updatedb":false,"repeat":false,"bitrate":"128 Kbps","isStreaming":false,"title":"The Mission (M Is For Milla Mix)","artist":"Puscifer","album":"Sound Into Blood Into Wine","uri":"http://t1-4.p-cdn.us/access/1484830872071778748.mp3?version=5&lid=27752775&token=pNehErphfUgrjGEPodoD8QJ2UoRy17ZdBQaj1WUSdqX3j9EgDfft042%2FWQFoTP9oO4z9zAGMoagc8h8d014ByBmm8db5%2BDBXQcjHB550zjnVW8EQbZ%2B%2FFcooAVWKvWTY%2BQunElYYeQdlUVdp6TDdEHVNnYgbp%2B8mtbRoOs7FSinX7Kyb7Qb%2FDfyOHVA9JDrmdJ%2BKharvLmVxd%2BvxxW8Y6USTh8JN4JU0jJQ%2FdzHc2nEbT170VcvAFs3ivyQ3oeimrCUxdCeRLlhmczFsnG5NoLeznYEs225II9D6B2rXjuRyzGmKcOP1na32kJZRn1Y7taN%2B90jKhBR2U9DKmW9ncg%3D%3D","trackType":"mp3"}
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: CURRENT POSITION 0
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::syncState   stateService play
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::syncState   currentStatus play
Oct 12 15:44:06 volumiodev volumio[1255]: info: Received an update from plugin. extracting info from payload
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::pushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::pushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService pandora
Oct 12 15:44:06 volumiodev volumio[1255]: info: ControllerMpd::pushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreCommandRouter::servicePushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getTrack 0
Oct 12 15:44:06 volumiodev volumio[1255]: info: CONSUME SERVICE: Received update from a service different from the one supposed to be playing music. Skipping notification. Current pandora Received mpd
Oct 12 15:44:06 volumiodev volumio[1255]: info: ------------------------------ 34ms
Oct 12 15:44:06 volumiodev volumio[1255]: info: sendMpdCommand playlistinfo took 24 milliseconds
Oct 12 15:44:06 volumiodev volumio[1255]: verbose: ControllerMpd::parseTrackInfo
Oct 12 15:44:06 volumiodev volumio[1255]: info: ControllerMpd::pushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreCommandRouter::servicePushState
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getTrack 0
Oct 12 15:44:06 volumiodev volumio[1255]: info: CONSUME SERVICE: Received update from a service different from the one supposed to be playing music. Skipping notification. Current pandora Received mpd
Oct 12 15:44:06 volumiodev volumio[1255]: info: ------------------------------ 35ms
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreCommandRouter::volumioGetQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: CoreStateMachine::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646704] ControllerPandora::PandoraHandler::fetchTracks::fetchStationPlaylist
Oct 12 15:44:07 volumiodev volumio[1255]: info: [1634078647220] [Pandora] PandoraHandler::fetchTracks::fetchStationPlaylist: Retrieved Puscifer Radio playlist
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:07 volumiodev volumio[1255]: info: [1634078647222] ControllerPandora::PandoraHandler::fetchTracks::fillNewTracks
Oct 12 15:44:07 volumiodev volumio[1255]: info: [1634078647226] [Pandora] PandoraHandler::fetchTracks::fillNewTracks: Fetched 4 track(s)
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::addQueueItems
Oct 12 15:44:07 volumiodev volumio[1255]: info: Adding Item to queue: /pandora/stationToken=3583959267178674503trackId=8522279127336170882
Oct 12 15:44:07 volumiodev volumio[1255]: info: Exploding uri /pandora/stationToken=3583959267178674503trackId=8522279127336170882 in service pandora
Oct 12 15:44:07 volumiodev volumio[1255]: info: [1634078647231] ControllerPandora::explodeUri
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:07 volumiodev volumio[1255]: info: Adding Item to queue: /pandora/stationToken=3583959267178674503trackId=6974328891770073459
Oct 12 15:44:07 volumiodev volumio[1255]: info: Exploding uri /pandora/stationToken=3583959267178674503trackId=6974328891770073459 in service pandora
Oct 12 15:44:07 volumiodev volumio[1255]: info: [1634078647234] ControllerPandora::explodeUri
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:07 volumiodev volumio[1255]: info: Adding Item to queue: /pandora/stationToken=3583959267178674503trackId=1144245746049276676
Oct 12 15:44:07 volumiodev volumio[1255]: info: Exploding uri /pandora/stationToken=3583959267178674503trackId=1144245746049276676 in service pandora
Oct 12 15:44:07 volumiodev volumio[1255]: info: [1634078647235] ControllerPandora::explodeUri
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:07 volumiodev volumio[1255]: info: Adding Item to queue: /pandora/stationToken=3583959267178674503trackId=7542407005084485367
Oct 12 15:44:07 volumiodev volumio[1255]: info: Exploding uri /pandora/stationToken=3583959267178674503trackId=7542407005084485367 in service pandora
Oct 12 15:44:07 volumiodev volumio[1255]: info: [1634078647236] ControllerPandora::explodeUri
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::saveQueue
Oct 12 15:44:07 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushQueue
Oct 12 15:44:07 volumiodev volumio[1255]: info: CoreStateMachine::updateTrackBlock
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::getTrackBlock
Oct 12 15:44:07 volumiodev volumio[1255]: info: [1634078647255] ControllerPandora::getStationTracks
Oct 12 15:44:07 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:44:07 volumiodev volumio[1255]: info: [1634078647256] [Pandora] PandoraHandler::getSongMaxDiff: -8
^C

Here is the logging from loading from my code journalctl:

Oct 12 15:39:38 volumiodev systemd-timesyncd[379]: interval/delta/delay/jitter/drift 2048s/-0.000s/0.165s/0.001s/-2ppm
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioClearQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::ClearQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::stop
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:39:56 volumiodev volumio[1255]: verbose: UNSET VOLATILE
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::clearPlayQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::saveQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushState
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioReplaceandPlayItems
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::ClearQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::stop
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:39:56 volumiodev volumio[1255]: verbose: UNSET VOLATILE
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::clearPlayQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::saveQueue
Oct 12 15:39:56 volumiodev python3[11783]: 192.168.4.27 - - [12/Oct/2021 15:39:56] "GET /pandora2/ HTTP/1.1" 200 -
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushState
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::addQueueItems
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::addQueueItems
Oct 12 15:39:56 volumiodev volumio[1255]: info: Adding Item to queue: /pandora/stationToken=4699546528046872903
Oct 12 15:39:56 volumiodev volumio[1255]: info: Exploding uri /pandora/stationToken=4699546528046872903 in service pandora
Oct 12 15:39:56 volumiodev volumio[1255]: info: [1634078396223] ControllerPandora::explodeUri
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioReplaceandPlayItems
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::ClearQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::stop
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:39:56 volumiodev volumio[1255]: verbose: UNSET VOLATILE
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::clearPlayQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::saveQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushState
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::executeOnPlugin: volumiodiscovery , saveDeviceInfo
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::addQueueItems
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::addQueueItems
Oct 12 15:39:56 volumiodev volumio[1255]: info: Adding Item to queue: /pandora/stationToken=3583959267178674503
Oct 12 15:39:56 volumiodev volumio[1255]: info: Exploding uri /pandora/stationToken=3583959267178674503 in service pandora
Oct 12 15:39:56 volumiodev volumio[1255]: info: [1634078396227] ControllerPandora::explodeUri
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::getQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::saveQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::saveQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPushQueue
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::updateTrackBlock
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::getTrackBlock
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::updateTrackBlock
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::getTrackBlock
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPlay
Oct 12 15:39:56 volumiodev volumio[1255]: verbose: UNSET VOLATILE
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::play index 0
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreCommandRouter::volumioPlay
Oct 12 15:39:56 volumiodev volumio[1255]: verbose: UNSET VOLATILE
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::play index 0
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::stop
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:39:56 volumiodev volumio[1255]: verbose: UNSET VOLATILE
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::stop
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:39:56 volumiodev volumio[1255]: verbose: UNSET VOLATILE
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::play index undefined
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::play index undefined
Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::setConsumeUpdateService undefined
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::getTrack 0
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::getTrack 0

It looks like Volumio is trying to push the uri of the Station to the Volumio Queue

Oct 12 15:39:56 volumiodev volumio[1255]: info: CoreStateMachine::addQueueItems
Oct 12 15:39:56 volumiodev volumio[1255]: info: CorePlayQueue::addQueueItems
Oct 12 15:39:56 volumiodev volumio[1255]: info: Adding Item to queue: /pandora/stationToken=4699546528046872903
Oct 12 15:39:56 volumiodev volumio[1255]: info: Exploding uri /pandora/stationToken=4699546528046872903 in service pandora
Oct 12 15:39:56 volumiodev volumio[1255]: info: [1634078396223] ControllerPandora::explodeUri

rather than the individual tracks as shown in your output here:

Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646329] ControllerPandora::PandoraHandler::fetchTracks::fillNewTracks
Oct 12 15:44:06 volumiodev volumio[1255]: info: [1634078646330] [Pandora] PandoraHandler::fetchTracks::fillNewTracks: Fetched 4 track(s)
Oct 12 15:44:06 volumiodev volumio[1255]: info: CorePlayQueue::addQueueItems
Oct 12 15:44:06 volumiodev volumio[1255]: info: Adding Item to queue: /pandora/stationToken=3583959267178674503trackId=1484830872071778748
Oct 12 15:44:06 volumiodev volumio[1255]: info: Exploding uri /pandora/stationToken=3583959267178674503trackId=1484830872071778748 in service pandora

It seems like we need to get Volumio to “Browse to this Uri” rather than “Add raw Uri to Volumio Queue”.

I suppose either the fetchTracks plugin function needs to be exposed and called every so often, or somehow start the plugin so it does it automatically and then would have to be stopped somehow, perhaps with a different Volumio API call.

The first one could be done but you would have to make multiple API calls, perhaps on a timer or on some signal that Volumio or the plugin would emit. Perhaps you could make a plugin API call to the fetchTracks function. I am fairly certain I could expose that function for you and the relevant track data through an API call, either via MQTT or an alternate method.

The second would just run and run, I suppose, as the plugin does. There would be less intervention but also less information returned.

What do you think?

This code here from index.js could be moved to a separate function. If this function were exposed, I think the “plugin loop” would start rolling along and then would have to be stopped somehow.

else if (curUri.match(uriStaRE) !== null) {
    const stationToken = curUri.match(uriStaRE)[1];

    return checkForStationChange(stationToken)
        .then(() => self.pandoraHandler.fetchTracks())
        .then(() => {
            self.lastUri = null;
            self.cameFromMenu = true;

            return self.pandoraHandler.getNewTracks()
                .then(newTracks => {
                    if (newTracks.length > 0) {
                        return self.commandRouter.stateMachine.playQueue.addQueueItems(newTracks)
                            .then(() => self.getQueueIndex(newTracks[0].uri))
                            .then(index => {
                                self.setCurrQueuePos(index);
                                return self.commandRouter.stateMachine.play(index);
                            });
                    }

                    self.commandRouter.pushToastMessage('error', 'Pandora',
                    'Failed to load tracks from ' + self.currStation.name);

                    return self.pUtil.generalReject(fnName, 'Failed to load tracks from ' +
                        self.currStation.name);
                });
        });
}

Hi Truckershitch,

Your post led me to browse the individual stationToken manually (via the browse API):

http://volumiodev:3000/api/V1/browse?uri=/pandora/stationToken=3583959267178674503

Initially I expected to get a list of tracks in that station that I would then have to load manually, however it actually loaded the first 5 tracks and started playing them (with no response back to the API call). That is the functionality I was looking for. If I skip to the next track it loads additional tracks as expected.

This is unexpected behavior, however I can support it in my code and no additional work for you and easier for me since I don’t have to manually add tracks. I will play with this but it seems that it is loading additional track and expiring tracks as expected. The only issue I can see is if this behavior changes in the future.

Thanks for the great plugin and pointing me in the right direction. One suggested feature is to intercept the “Add to Favorites” (the heart) and send a thumbs up to Pandora. The favorited function does not do anything currently.

Glenn

Hey, no problem! I’m glad to help.

Your suggestion is a good one. I’ll see what I can do there. I have “thumbs down” in the code already. The tricky bit is figuring out the Favorites trigger. :slight_smile:

I haven’t looked at this code in a few months. Every time I do, I have to revisit JavaScript all over again as I don’t have much experience with it. It’s always an adventure.

Hi. I use Volumio Primo as my Pandora streamer and am very grateful for all the work you have put into the plugin.

I was wondering if you will be updating the plugin to work with Volumio 3.0. I don’t want to upgrade to 3.0 if I lose access to Pandora.

Thanks, Mark.

Hey Mark!

I’ve been running the 3.x Buster betas for a while now and haven’t had any real issues save the ones I’ve made myself :slight_smile: I updated to 3.152 a few days ago and just now started the upgrade to the 3.163 release a minute ago.

I do not expect any problems, but let me just let this upgrade finish, grab a sandwich and give it a whirl to be certain. I’ll post an update in about an hour.

Everything looks good here for the Pandora plugin. I can’t speak for any other plugins you may have installed.

The best bet is to back up your Volumio instance. There are more than a few ways to do that if you don’t have a spare microSD card.

If you do have a spare card, I’d just make a testing card until you’re certain things are working for you.

I’m not seeing Pandora in the plugin list now that I’ve upgraded to the 3.0 release?

Hey @downtownHippie

Maybe it isn’t on the volumio servers yet. You can install manually, the instructions are on the GitHub page linked on the first post.

Fabulous. Thanks for the speedy reply.

I went to Github and the version I see there is v2.9.2. Is the 3.163 available somewhere else?

Also, I have noticed in the last month that I have to save the Pandora credentials every time I go to use it. Seems that it is timing out. Any suggestions?

Thanks, Mark.

Hey @mkmkeeto

When I posted my reply, 3.163 was the Volumio Buster Beta version I was using. 2.9.2 is the current Pandora plugin version.

The plugin is not currently available to be installed through the interface. Hopefully, this will be fixed soon, but until then one can follow the steps on the GitHub page. It takes a minute or two because the libraries have to be sourced and installed. The speed depends on the machine used, network speed, etc. Just go grab a coffee and it should work out.

I’m not sure what is going on there. All of the settings are stored in a single .json file. The path to this file is /data/configuration/music_service/pandora/config.json When I’m testing, I like to keep a copy of this file in my home directory so I can copy it to the right place.

When the plugin is first installed, a mostly blank config.json with defaults is written to that location. Really, you should not need to change this at all, but it may come in handy if you want to add bands to the “ignore” list or something like that. Your Pandora credentials will be written to that file in plain text.

I’m not sure if you would need to do this, but that config.json with defaults can be found in the GitHub repo as well if you wanted to start with a fresh file. This hasn’t happened to me before. The reads / writes to that file uses a standard Volumio process that should handle it. Maybe your password has a strange character in it? Just a wild guess.

I installed 2.9.2 from your Github files onto Volumio 3 on a Pi and it is working great. Haven’t had a chance to see if the Pandora credentials stick. It was very speedy and I didn’t even have time to get my coffee!

The credential problem I was having was on a Primo unit. I had been using Pandora on Volumio 2/Raspberry Pi before without any problems. I think I will wait on upgrading the Primo to 3.0 until a few more of the bugs are sorted out.

If needed I will replace the config.json file on that unit and see if that fixes the credential issues.

I so appreciate all the effort you have made to develop and share the plugin. I wouldn’t be using Volumio if it weren’t for the Pandora plugin. So thanks for that.

Cheers, Mark.

@mkmkeeto
No problem!

I’m glad you like it. I got frustrated a few times during the development but it gave me something to do during these crazy times, especially in the beginning.

I have used a lot of free software over the years and I thought it was time to give back a little bit. So here it is.

To everyone else:
I think the main developers are pretty busy right now with the initial release, and I expect that the Pandora plugin will be added to the main menu soon. In the meantime, if you go to my GitHub fork, linked at the top of this thread, there are instructions on how to install it manually. A few commands must be typed in manually at the prompt, but one should be able to cut and paste them from the instructions listed there (in the README.md file).

As always, if you have a problem, post it here. I’ll try to help you, and if we find a solution it might help someone else.

Rock on.

Hi Truckershitch, thanks again for the effort on this plugin. I have also been running volumio3 with the plugin manually installed. My custom app still works with the plugin unchanged. The only glitch is occasionally it will stop playing after the first song. Play/ffw doesn’t work, selecting a track from the queue does work and plays smoothly from there. I’ll try to get the root of the issue over the holidays.

@GlennBurnett

I haven’t seen that particular issue before. The plugin does a large amount of logging to the console so perhaps that will give a clue. You can try opening a ssh session and entering

journalctl -f

to see if you can spot when it happens. The output is chatty and will show what is happening on your system. There is no “extra verbosity” option in the plugin – it logs in debug mode by default. If you can see when it happens, we can try to log more information if needed.

The issue I have seen that might be related:

For a while, when I first started Volumio, right after restarting the machine or powering it on and enabling the plugin – perhaps after merely enabling the plugin when the machine was already on? (I usually disable it / switch it off when I’m done listening), the plugin would put the first 4 tracks in the queue twice. So the queue would be song 1, 2, 3, 4, 1, 2, 3, 4. This would clean up by itself.

That seems to have stopped. I don’t think I fixed it and I’m not sure what was happening.

That’s all I can think of there. At the moment I am not having too many problems but I am not listening to it every day either. I wrote the thing but I am not a heavy user. :slight_smile:

Hi Truckershitch,

Sorry for the late reply, Belowis the journalctl output.

Line 20 is the request to load the station (browse function is called from my app to load and play)

Line 1198 is where my app calls the play command because it stopped playing after the first track (socket IO Command)

  • it replays the current song, so it never advanced to the next song.

Line 1420 I hit the next command to advance the track off the duplicate playing.

Let me know if I didn’t capture enough.

Thanks!!

GlennProcessing: journalctl.log…
journalctl.txt (148.5 KB)