[GH-ISSUE #857] "Authentication Failed" when pasting request headers from Chrome #524

Open
opened 2026-02-27 23:01:16 +03:00 by kerem · 1 comment
Owner

Originally created by @apastel on GitHub (Jan 27, 2026).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/857

  • I confirm that I have read the FAQ

Describe the bug

When pasting request headers from Chrome (even though Firefox is recommended), the authentication process fails with:

ytmusicapi.exceptions.YTMusicUserError: 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.

The reason this happens is because starting sometime early last year, Chrome request headers are copied to your clipboard without a colon at the end of each key. For example:

accept
*/*
accept-encoding
gzip, deflate, br, zstd
accept-language
en-US,en;q=0.9

This breaks the parser in browser.py:setup_browser.

I've been working on a solution but it's a bit tricky since now the header keys and header values don't have any distinguishing characteristics from each other -- you kind of just have to assume the first line is a key and the 2nd line is a value and go from there.

References:

We could port over that fix to ytmusicapi but I'm not super proud of it. I would rather start with the existing fix that uses chrome_remembered_key and modify that instead. I started to work on something but so far it's not quite working yet.

ytmusicapi version

1.11.4

To Reproduce

Steps to reproduce the behavior:

  1. Follow instructions to paste request headers, use Chrome instead of Firefox
  2. Observe error in terminal.
Originally created by @apastel on GitHub (Jan 27, 2026). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/857 - [x] I confirm that I have read the [FAQ](https://ytmusicapi.readthedocs.io/en/stable/faq.html#why-is-ytmusicapi-returning-more-results-than-requested-with-the-limit-parameter) **Describe the bug** When pasting request headers from Chrome (even though Firefox is recommended), the authentication process fails with: ``` ytmusicapi.exceptions.YTMusicUserError: 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. ``` The reason this happens is because starting sometime early last year, Chrome request headers are copied to your clipboard without a colon at the end of each key. For example: ``` accept */* accept-encoding gzip, deflate, br, zstd accept-language en-US,en;q=0.9 ``` This breaks the parser in `browser.py:setup_browser`. I've been working on a solution but it's a bit tricky since now the header keys and header values don't have any distinguishing characteristics from each other -- you kind of just have to assume the first line is a key and the 2nd line is a value and go from there. References: * Closed ticket from 2023 that fixed Chrome headers when they used to have colons: #409 * Discussion on this I opened last year: #793 * Fix I implemented in my own project last year before I knew about issue 409 : https://github.com/apastel/ytmusic-deleter/blob/56726397b849d523d16de1e8799036e7a6133b4c/ytmusic_deleter/common.py#L94 We _could_ port over that fix to ytmusicapi but I'm not super proud of it. I would rather start with the existing fix that uses `chrome_remembered_key` and modify that instead. I started to work on something but so far it's not quite working yet. **ytmusicapi version** 1.11.4 **To Reproduce** Steps to reproduce the behavior: 1. Follow instructions to paste request headers, use Chrome instead of Firefox 2. Observe error in terminal.
Author
Owner

@sigma67 commented on GitHub (Jan 31, 2026):

PR welcome

<!-- gh-comment-id:3828026543 --> @sigma67 commented on GitHub (Jan 31, 2026): PR welcome
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#524
No description provided.