[GH-ISSUE #270] Authentication Errors: Headers not present in /browse #208

Closed
opened 2026-02-27 22:08:36 +03:00 by kerem · 4 comments
Owner

Originally created by @Zaedus on GitHub (May 7, 2022).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/270

I'm not sure if this is a new change to the Youtube Music api, but I can't seem to reauthenticate myself. When I copy the headers from the /browse request, I end up with this

Exception: The following entries are missing in your headers: x-goog-authuser. Please try a different request (such as /browse) and make sure you are logged in.

I'm not sure if I'm just doing something wrong, or if this is a change to how Youtube handles authentication.

Originally created by @Zaedus on GitHub (May 7, 2022). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/270 I'm not sure if this is a new change to the Youtube Music api, but I can't seem to reauthenticate myself. When I copy the headers from the `/browse` request, I end up with this ``` Exception: The following entries are missing in your headers: x-goog-authuser. Please try a different request (such as /browse) and make sure you are logged in. ``` I'm not sure if I'm just doing something wrong, or if this is a change to how Youtube handles authentication.
kerem 2026-02-27 22:08:36 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@cyperdark commented on GitHub (May 8, 2022):

{
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0",
  "Accept": "*/*",
  "Accept-Language": "en-US,en;q=0.5",
  "Content-Type": "application/json",
  "X-Goog-AuthUser": "1",
  "x-origin": "https://music.youtube.com",
  "Cookie": ""
}

copy cookie value and paste it

<!-- gh-comment-id:1120333079 --> @cyperdark commented on GitHub (May 8, 2022): ```json { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0", "Accept": "*/*", "Accept-Language": "en-US,en;q=0.5", "Content-Type": "application/json", "X-Goog-AuthUser": "1", "x-origin": "https://music.youtube.com", "Cookie": "" } ``` copy cookie value and paste it
Author
Owner

@sigma67 commented on GitHub (May 9, 2022):

Normally your request headers should include a value "x-goog-authuser" to indicate which of your Google brand accounts you're signed in to. For some reason yours doesn't, but you can just manually create a new entry in your copied headers with the value "0" and it should work.

Do you have any other brand accounts on your Google account? You can tell by clicking your user icon, then Switch Accounts.

<!-- gh-comment-id:1120950930 --> @sigma67 commented on GitHub (May 9, 2022): Normally your request headers should include a value "x-goog-authuser" to indicate which of your Google brand accounts you're signed in to. For some reason yours doesn't, but you can just manually create a new entry in your copied headers with the value "0" and it should work. Do you have any other brand accounts on your Google account? You can tell by clicking your user icon, then Switch Accounts.
Author
Owner

@Zaedus commented on GitHub (Jun 13, 2022):

So sorry for the late response. Do I need a google account for this or can I access it as a guest?

<!-- gh-comment-id:1153465205 --> @Zaedus commented on GitHub (Jun 13, 2022): So sorry for the late response. Do I need a google account for this or can I access it as a guest?
Author
Owner

@Zaedus commented on GitHub (Jun 13, 2022):

Oh. My. God. I am so sorry! I thought it was necessary to get the headers for both unauthenticated and authenticated requests! That is 100% my bad. Enjoy the rest of your day and thank you for sticking with me here :)

<!-- gh-comment-id:1153466885 --> @Zaedus commented on GitHub (Jun 13, 2022): Oh. My. God. I am so sorry! I thought it was necessary to get the headers for both unauthenticated and authenticated requests! That is 100% my bad. Enjoy the rest of your day and thank you for sticking with me here :)
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#208
No description provided.