xboxlive-api icon indicating copy to clipboard operation
xboxlive-api copied to clipboard

Getting the full list of Game Clips for a user account

Open aaron-bond opened this issue 4 years ago • 16 comments

Hi, I've been using this package for a year or so now and it's been great! Thanks for open-sourcing this, it's been a great help.

I noticed recently the point about the mid-2019 games not being returned by the current getPlayerGameclips method (related to https://github.com/XboxReplay/xboxlive-api/issues/5 ?)

The suggestion to use the getPlayerGameClipsFromActivityHistory was promising so I updated the package to v3 and switched over. However, now I'm only seeing 2 clips come back for a given user, regardless of what I put in the numItems field.

Is there a workaround that will allow me to see all clips for a user, even for recent games?

aaron-bond avatar Dec 17 '20 22:12 aaron-bond

Hey,

Unfortunately, the "activity" trick doesn't work anymore and games such as Cyberpunk 2077 won't be returned.

The only viable workaround is the use "mediahub.xboxlive.com" domain (which is used by mobile / desktop apps) but it requires a XSTSToken created from UserToken, TitleToken and DeviceToken combination.

Right now, this library can not handle it by itself.

Good news, the upcoming update of XboxReplay.net and its API (v2) will. Another good news, you'll be able to use it for free.

I'm leaving this issue opened and I'll communicate about the update in a few weeks.

Alexis-Bize avatar Dec 18 '20 08:12 Alexis-Bize

A new branch (4.0.0) has been created.

  • https://github.com/XboxReplay/xboxlive-api/tree/4.0.0

To overcome this issue, this library will expose additional methods to call the upcoming v2 XboxReplay API ; which is able to retrieve all missing content.

Once the update is live, the library will be updated.

Alexis-Bize avatar Jan 10 '21 16:01 Alexis-Bize

Ah, excellent. I'll give this a go when I get a bit of time.

So this will mean we're hitting your back end service, rather than going directly to MS, is that right?

aaron-bond avatar Jan 10 '21 18:01 aaron-bond

If you must, yes :)

Alexis-Bize avatar Jan 10 '21 18:01 Alexis-Bize

With the requirements for the device specific headers etc. does that rule out decentralising it in the way it was before? It's handy being able to go straight to MS since it won't add extra load on intermediaries

aaron-bond avatar Jan 10 '21 18:01 aaron-bond

Everything is cached on XR side (max TTL of 15 minutes) and pulled from the mediahub endpoint with a valid XSTS token (signed + title / device combination).

If you really want to exclusively use XSAPI endpoints (Xbox Services API), upcoming endpoints will allow you to create your own signed XSTS token which grants the same access as XboxReplay to this service.

Alexis-Bize avatar Jan 10 '21 18:01 Alexis-Bize

Ah, that's pretty comprehensive. Good to know both options exist. I look forward to giving this a go!

aaron-bond avatar Jan 10 '21 19:01 aaron-bond

Major update: As recently specified on @XboxReplay twitter account, due to an internal privacy update on XBL APIs, there's no way anymore to retrieve recent users' screenshots (except for ESRB:E (Everyone) rated games such as Minecraft).

The only way to fetch them is to ask the user to authenticate itself on XboxReplay.net (for instance) and use its token to fetch its content.

This process also requires "signed tokens" but as I managed to reverse the signature algorithm, this is not an issue (already used on halodotapi.com projects).

Note: Current XboxReplay API is able to fetch all recent clips ;)

Alexis-Bize avatar Jul 26 '21 10:07 Alexis-Bize

Hi there,

I am trying to use this library to get clips but I am seeing next to nothing when using my gamertags. This issue seems relevant, but I am confused as to the status of things and the solutions to the issues.

It sounds like the 4.0.0 branch might work? Or is there more to it?

RyanEwen avatar Sep 24 '21 02:09 RyanEwen

I tried 4.0.0 but I get a 404 error when trying to fetch clips via getPlayerGameClips, which uses https://mediahub.xboxlive.com/clips/search. Some internet searching led me nowhere with regard to that.

The documentation for 4.0.0 mentions an XboxReplay wrapper, which sounds like it uses xboxreplay.net as a middle man, but it requires a token, and I don't see anything on the site about signing up and getting a token. EDIT: Found more about it here: https://github.com/XboxReplay/xboxreplay-public-api

I realize 4.0.0 is WIP, but any help is appreciated! Would be nice not to relay through other services. Cheers!

RyanEwen avatar Sep 24 '21 03:09 RyanEwen

Hi, is there a merge between the branch 4.0 and the main branch planned ?

xenursXX avatar Nov 14 '21 19:11 xenursXX

Hey there, just wanted to add in my interest for an update to this repo and the 4.0 branch. I pulled down the branch and tried using getPlayerGameClips but get 404s when trying to hit https://mediahub.xboxlive.com/clips/search. Would love an update on this so we could directly make calls to the MS service!

Develonaut avatar Nov 25 '21 14:11 Develonaut

Hey @RyanEwen @xenursXX @Develonaut, sorry for the late reply.

Right now I do not have bandwidth to continue my work on the 4.0.0 and the new XboxReplay API due to my major implication on HaloDotAPI (see: https://autocode.com/community/announcements/halodotapi-is-joining-autocode/)

Once everything is done I may be able to finish it :) Cheers!

Alexis-Bize avatar Dec 15 '21 10:12 Alexis-Bize

@RyanEwen @Develonaut the right endpoint for mediahub is https://mediahub.xboxlive.com/gameclips/search. I request like this should work:

curl --location --request POST 'https://mediahub.xboxlive.com/gameclips/search' \
--header 'Authorization: XBL3.0 x=userhash;xsts_token \
--header 'Content-Type: application/json' \
--data-raw '{"query": "OwnerXuid eq xuid"}'

However, using this endpoint, I'm still missing some clips for specific games, like FIFA and Halo Infinite. If you guys find a solution for that, please share :)

KarineValenca avatar Jan 13 '22 11:01 KarineValenca

@RyanEwen @Develonaut the right endpoint for mediahub is https://mediahub.xboxlive.com/gameclips/search. I request like this should work:

curl --location --request POST 'https://mediahub.xboxlive.com/gameclips/search' \
--header 'Authorization: XBL3.0 x=userhash;xsts_token \
--header 'Content-Type: application/json' \
--data-raw '{"query": "OwnerXuid eq xuid"}'

However, using this endpoint, I'm still missing some clips for specific games, like FIFA and Halo Infinite. If you guys find a solution for that, please share :)

@KarineValenca were you able to find a way to grab clips for Halo Infinite? I'm having the same issue.

ferhanmm avatar Mar 18 '22 15:03 ferhanmm

@ferhanmm no luck yet :/

KarineValenca avatar Mar 18 '22 20:03 KarineValenca