sonos-web icon indicating copy to clipboard operation
sonos-web copied to clipboard

Unable to get Plex URLs to queue

Open wwwizzarrdry opened this issue 6 years ago • 6 comments

Anyone else getting upnp 701 errors when they queue Plex tracks?

It's not unique to Sonos-web. It happens with all Sonos apis, as well as manually adding tracks.

Would like to know what Sonos is expecting here.

wwwizzarrdry avatar Nov 12 '18 09:11 wwwizzarrdry

Does this happen with particular song formats?
Can you provide a log?

denysvitali avatar Nov 12 '18 09:11 denysvitali

Seems to be anything I throw at it the Sonos api. I can upload the logs in a little bit, but it's definitely not specific to your implementation as this happens with every Sonos API i've tried.

UnhandledPromiseRejectionWarning: StatusCodeError: 500 - 
<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">
    <s:Body>
    <s:Fault>
        <faultcode>s:Client</faultcode>
        <faultstring>UPnPError</faultstring>
        <detail>
            <UPnPError xmlns=\"urn:schemas-upnp-org:control-1-0\">
                <errorCode>800</errorCode>
            </UPnPError>
        </detail>
        </s:Fault>
    </s:Body>
</s:Envelope>
at new StatusCodeError (C:\Users\wwwiz\Projects\node\sonos-web\node_modules\request-promise-core\lib\errors.js:32:15)
at Request.plumbing.callback (C:\Users\wwwiz\Projects\node\sonos-web\node_modules\request-promise-core\lib\plumbing.js:104:33)
at Request.RP$callback [as _callback] (C:\Users\wwwiz\Projects\node\sonos-web\node_modules\request-promise-core\lib\plumbing.js:46:31)
at Request.self.callback (C:\Users\wwwiz\Projects\node\sonos-web\node_modules\request\request.js:185:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (C:\Users\wwwiz\Projects\node\sonos-web\node_modules\request\request.js:1161:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (C:\Users\wwwiz\Projects\node\sonos-web\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

wwwizzarrdry avatar Nov 12 '18 12:11 wwwizzarrdry

TL;DR This was a Plex/Certificate issue not accepting https URIs.

So interestingly enough, this whole time I've been trying to use SSL for my plex uris, but i just tried manually queueing http://192.168.2.115:32400/library/parts/316583/1351232504/file.mp3?X-Plex-Token=xxxx and it worked. Strangely, this works in fine in the browsers resource locator, just not via the Sonos api.

I'll modify your plugin to make this work over http. You may close this issue if you like.

wwwizzarrdry avatar Nov 12 '18 13:11 wwwizzarrdry

You shouldn't be using https URLs with invalid certificates. That's why Plex created the *.plex.direct domain. You should take a look at the "Network" table on your browser when you visit the Plex page of your server, and extract the *.plex.direct hostname. For example: https://172-27-0-1.c7326dc46090423aa694172c95f89272.plex.direct:32400.

denysvitali avatar Nov 12 '18 13:11 denysvitali

Thanks for the info. Strange that I get different error codes depending on how I queie the track though. You'd think that a cert error would return the same error code across implementations.

wwwizzarrdry avatar Nov 12 '18 13:11 wwwizzarrdry

No idea. Sonos's player implementation (anacapactl) kinda sucks. It has many unpredictable behaviors that I still don't understand...

denysvitali avatar Nov 12 '18 14:11 denysvitali