[GH-ISSUE #46] Match 'X-Goog-AuthUser' during setup. #35

Closed
opened 2026-02-27 22:07:40 +03:00 by kerem · 3 comments
Owner

Originally created by @larntz on GitHub (Jul 16, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/46

Thanks for writing this! I was playing around with it and noticed that during setup it does not copy the number from the request header X-Goog-AuthUser.

In the pasted headers from firefox contained:

X-Goog-AuthUser: 2

But the generated header_auth.json was using:

"X-Goog-AuthUser": "0"

This was causing my liked songs, playlists, etc to be pulled from different google account that I don't use with youtube music.

I have a few google accounts. I'm not sure how google handles all that. This particular account is not a brand account, and I didn't notice this in the docs so thought I'd let you know.

I noticed the AuthUser number matches this url when selecting the correct account: https://myaccount.google.com/u/2/?pli=1 (the 2 changes to 0 on my default account).

I changed the value X-Goog-AuthUser to match the firefox request headers and it worked perfectly.

Thanks again! Let me know if you need more info.

Originally created by @larntz on GitHub (Jul 16, 2020). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/46 Thanks for writing this! I was playing around with it and noticed that during setup it does not copy the number from the request header X-Goog-AuthUser. In the pasted headers from firefox contained: ``` X-Goog-AuthUser: 2 ``` But the generated header_auth.json was using: ``` "X-Goog-AuthUser": "0" ``` This was causing my liked songs, playlists, etc to be pulled from different google account that I don't use with youtube music. I have a few google accounts. I'm not sure how google handles all that. This particular account is not a brand account, and I didn't notice this in the docs so thought I'd let you know. I noticed the AuthUser number matches this url when selecting the correct account: https://myaccount.google.com/u/2/?pli=1 (the 2 changes to 0 on my default account). I changed the value X-Goog-AuthUser to match the firefox request headers and it worked perfectly. Thanks again! Let me know if you need more info.
kerem closed this issue 2026-02-27 22:07:40 +03:00
Author
Owner

@sigma67 commented on GitHub (Jul 17, 2020):

Good point, I always used the first account in the list so I didn't notice. Should be an easy fix in setup.py.

<!-- gh-comment-id:659975242 --> @sigma67 commented on GitHub (Jul 17, 2020): Good point, I always used the first account in the list so I didn't notice. Should be an easy fix in `setup.py`.
Author
Owner

@sigma67 commented on GitHub (Jul 18, 2020):

Can you please verify that the issue is fixed with the latest commit?

<!-- gh-comment-id:660489420 --> @sigma67 commented on GitHub (Jul 18, 2020): Can you please verify that the issue is fixed with the latest commit?
Author
Owner

@gaganpreet commented on GitHub (Nov 1, 2020):

Unfortunately this commit wasn't enough, I added X-Goog-AuthUser to required_headers to make it work correctly. I'll create a PR shortly with my fix.

<!-- gh-comment-id:720063248 --> @gaganpreet commented on GitHub (Nov 1, 2020): Unfortunately this commit wasn't enough, I added `X-Goog-AuthUser` to required_headers to make it work correctly. I'll create a PR shortly with my fix.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#35
No description provided.