Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New method to resolve sessionToken #35

Closed
kfsboss opened this issue Jul 25, 2022 · 10 comments
Closed

New method to resolve sessionToken #35

kfsboss opened this issue Jul 25, 2022 · 10 comments

Comments

@kfsboss
Copy link

kfsboss commented Jul 25, 2022

Header:
x-origin: https://studio.youtube.com Authorization: [Replace Your SAPISIDHASH] Content-Type: application/json Cookie: [Replace Your Cookie]

1: POST https://studio.youtube.com/youtubei/v1/security/get_web_reauth_url?alt=json&key=$KEY

Data:
{ "context": { "client": { "clientName": 62, "clientVersion": "1.20220711.03.00", "hl": "en", "gl": "US", }, }, "continueUrl": "https://studio.youtube.com/reauth", "flow": "REAUTH_FLOW_YT_STUDIO_COLD_LOAD", "ivctx": "[Replace Your !!! [ivctx] !!! Required]" }

[encodedReauthProofToken] get the Responses
[sessionRiskCtx] get the Responses

2: POST https://studio.youtube.com/youtubei/v1/ars/grst?alt=json&key=$KEY

Data:
{ "context": { "client": { "clientName": 62, "clientVersion": "1.20220720.01.00", "hl": "en", "gl": "US", }, "request": { "returnLogEntry": true, "internalExperimentFlags": [], "reauthRequestInfo": { "[Replace Your !!! [encodedReauthProofToken] !!! Required]" } }, }, "ctx": "[Replace Your !!! [sessionRiskCtx] !!! Required]" }
[sessionToken] get the Responses

//
**perfect solution,Data information can be filled in completely if necessary **
example:
"user": { "onBehalfOfUser": "[Replace Your UserID]", "delegationContext": { "externalChannelId": "[Replace Your ChannelId@]", "roleType": { "channelRoleType": "CREATOR_CHANNEL_ROLE_TYPE_OWNER" } },

//
sessionToken generally expires in seven days, this scheme can automatically obtain new

@blueveno
Copy link

blueveno commented Jul 27, 2022

how can i get botguardResponse data?
if i use https://studio.youtube.com/youtubei/v1/att/esr without "botguardResponse", always return wrong ivctx
Or other way to get ivctx?

@adasq
Copy link
Owner

adasq commented Jul 27, 2022

Thank you both for your input.

That's indeed interesting. I briefly checked it out and it looks like we can generate sessionToken without sending over botGuard details.

The only missing part is ivctx. Need to dig more.

@blueveno
Copy link

sessionToken can got from https://studio.youtube.com/youtubei/v1/att/esr response data, so only how you find the way got exactly botguardResponse. Thank you for your help

@adasq
Copy link
Owner

adasq commented Jul 27, 2022

Generating botguardResponse is a tricky part. AFAIR it's generated on the client-side by executing JavaScript (in conjunction with iframes).

I think it'd be easier to get ivctx

@femtoeu
Copy link

femtoeu commented Jul 27, 2022

Why is this method better? If we receive ivctx after we send botGuard?

@Litedown
Copy link

Hi. Creators, can you make something like "auto generating" of sessionToken? I want to use a lot of accounts and I need to get this sessionToken

@whoisbg
Copy link

whoisbg commented Aug 4, 2022

how to get ivctx?

@adasq
Copy link
Owner

adasq commented Aug 6, 2022

Follow up:
we can get ivctx from /esr. The problem is that this API that requires botGuardResponse.

@whoisbg
Copy link

whoisbg commented Aug 7, 2022

Follow up: we can get ivctx from /esr. The problem is that this API that requires botGuardResponse.

So all that's left is to understand how to generate botGuardResponse?

@ItzmeSwapy
Copy link

close to the solution guys... let's crack it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants