unknownskl / xbox-xcloud-player

Xbox-Xcloud-Player is a library that can connect to an xCloud / xHome stream using WebRTC and provides an API interface for controlling the stream.
151 stars 18 forks source link

Generating Token #203

Closed GonzalezAtWork closed 6 months ago

GonzalezAtWork commented 11 months ago

Can you give some directions on how to generate the Token? or is it possible to have the xbox login page builtin in this?

GonzalezAtWork commented 11 months ago

what I had to do:

inspect xbox.com/play and grab the payload for the call: https://xgpuweb.gssv-play-prod.xboxlive.com/v2/login/user

change it to the json:

{
    "offeringId": "xhome",
    "token": "<TOKEN ON THE CALL>"
}

and send it to the url: https://xhome.gssv-play-prod.xboxlive.com/v2/login/user

only then I could get the propper token to be used (on the gsToken).

to validate it, I did grab it on the result, the gsToken, and send it as "bearer token" for the url: https://uks.gssv-play-prodxhome.xboxlive.com/v6/servers/home what give me a list of the valid xboxes

is that the right process???

GonzalezAtWork commented 11 months ago

and even so, it is not working. Having the error:

"errorDetails": {
        "code": "AgentCommandError",
        "message": "Agent : -2147024894 : class Network::StartStreamingSessionV2Command failed. : State ServerStartStreamingV2CommandSent"
    }

I did try to change all v4 to v5 (once that is the version that comes in the servers/home page)

but still, no luck

FatCache commented 9 months ago

and even so, it is not working. Having the error:

"errorDetails": {
        "code": "AgentCommandError",
        "message": "Agent : -2147024894 : class Network::StartStreamingSessionV2Command failed. : State ServerStartStreamingV2CommandSent"
    }

I did try to change all v4 to v5 (once that is the version that comes in the servers/home page)

but still, no luck

I had the same issue. Restarting the Xbox or reinstall the App eventually fixes the issue.

unknownskl commented 6 months ago

Command npm run auth has been added to make it easier to authenticate. It uses the xal-node library for authentication to gather the tokens. With those tokens the gamestreaming token can be requested (which is done in this part of the server: https://github.com/unknownskl/xbox-xcloud-player/blob/main/src/Server.ts#L24-L50