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

Fix account index #3

Merged
merged 2 commits into from
Sep 2, 2024
Merged

Conversation

dnicolson
Copy link
Contributor

This fixes the YouTube.js account_index option.

It's not clear if this originally worked or not, the most recent review of the extension also indicates the account index option not working.

@terrygonguet
Copy link
Owner

I added the account_index option for someone who contacted me by email. I never managed to set things up to reproduce it but the option apparently worked for them.

Does this fix something for you that the YouTube.js account_index does not ?

@dnicolson
Copy link
Contributor Author

I have not been able to get multiple accounts to work with YouTube.js, I made some notes in LuanRT/YouTube.js#735.

I followed the description from LuanRT/YouTube.js#236 and with an extra step (LuanRT/YouTube.js#707 (comment)) but to no avail.

@terrygonguet
Copy link
Owner

Well, thanks for the effort. Honestly this looks pretty complicated for something we're not sure if it works or even if it's needed 😅

I would be grateful if you could add comments on how this thing works and so we'll have it on hand if we find someone who needs it 👍

@dnicolson
Copy link
Contributor Author

I think it is needed, the currently used account_index option doesn't seem to work as confirmed by the reviewer.

The window.ytcfg.get('DELEGATED_SESSION_ID') value determines which account is active, it is undefined if it is the primary account.

Data sync IDs identify additional accounts, these come from the /getDatasyncIdsEndpoint endpoint and are saved in local storage.

Adding the X-Goog-PageId header to Innertube requests determines the active account.

Here are examples of local storage data sync ID keys for the number of accounts signed in.

Three accounts:
id_1||id_2::yt-player::yt-player-lv
id_0||::yt-player::yt-player-lv

Two accounts:
id_1||id_0::yt-player::yt-player-lv
id_0||::yt-player::yt-player-lv

One account:
id_0||::yt-player::yt-player-lv

@terrygonguet terrygonguet merged commit 1e9e2bf into terrygonguet:master Sep 2, 2024
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

Successfully merging this pull request may close these issues.

2 participants