[GH-ISSUE #58] Setup authentication from Chrome/Chromium browsers #45

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

Originally created by @xplorr on GitHub (Aug 18, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/58

In the documentation https://ytmusicapi.readthedocs.io/en/latest/setup.html about setting up the authentication request, an example is given for Firefox browsers. However, I can't set it up for Chrome/Chromium browsers.
Would it be possible to add an example setup for Chrome/Chromium?

Originally created by @xplorr on GitHub (Aug 18, 2020). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/58 In the documentation https://ytmusicapi.readthedocs.io/en/latest/setup.html about setting up the authentication request, an example is given for Firefox browsers. However, I can't set it up for Chrome/Chromium browsers. Would it be possible to add an example setup for Chrome/Chromium?
kerem 2026-02-27 22:07:43 +03:00
Author
Owner

@akraus53 commented on GitHub (Aug 18, 2020):

Why don't you just download Firefox?

<!-- gh-comment-id:675570096 --> @akraus53 commented on GitHub (Aug 18, 2020): Why don't you just download Firefox?
Author
Owner

@akraus53 commented on GitHub (Aug 18, 2020):

Look here for an example of what the headers_auth file looks like.
Fill in what you need (the x-google-user-thingi and the cookie) and I hope you'll be set. Easiest is definitely downloading firefox though.

<!-- gh-comment-id:675574545 --> @akraus53 commented on GitHub (Aug 18, 2020): [Look here](https://github.com/akraus53/YTM-Scrobbler/blob/master/headers_auth.json.example) for an example of what the headers_auth file looks like. Fill in what you need (the x-google-user-thingi and the cookie) and I hope you'll be set. Easiest is definitely downloading firefox though.
Author
Owner

@xplorr commented on GitHub (Aug 18, 2020):

Thx.
Already found a method:
• open music.youtube.com in Chrome
• open dev tools (ctrl-shift-i)
• do some action in main page
• goto network tab
• filter on "json"
• look in "header" tab for string "cookie" and copy data
• open headers_auth.json and copy cookie data to "cookie"

<!-- gh-comment-id:675587669 --> @xplorr commented on GitHub (Aug 18, 2020): Thx. Already found a method: • open music.youtube.com in Chrome • open dev tools (ctrl-shift-i) • do some action in main page • goto network tab • filter on "json" • look in "header" tab for string "cookie" and copy data • open headers_auth.json and copy cookie data to "cookie"
Author
Owner

@akraus53 commented on GitHub (Aug 19, 2020):

You probably also need the "X-Goog-Visitor-Id" dont you?

<!-- gh-comment-id:675965950 --> @akraus53 commented on GitHub (Aug 19, 2020): You probably also need the "X-Goog-Visitor-Id" dont you?
Author
Owner

@akraus53 commented on GitHub (Aug 19, 2020):

If you're sure your way works, then I'd recomend you add to the reference (I'm happy to add a few lines/comments too because i thought it was kinda hard to understand what to do).

https://github.com/sigma67/ytmusicapi/blob/master/docs/source/setup.rst

When this issue is closed nobody will know how to do it

<!-- gh-comment-id:675971260 --> @akraus53 commented on GitHub (Aug 19, 2020): If you're sure your way works, then I'd recomend you add to the reference (I'm happy to add a few lines/comments too because i thought it was kinda hard to understand what to do). https://github.com/sigma67/ytmusicapi/blob/master/docs/source/setup.rst When this issue is closed nobody will know how to do it
Author
Owner

@akraus53 commented on GitHub (Aug 19, 2020):

Update: I improved the Firefox instructions.

https://github.com/sigma67/ytmusicapi/pull/60

<!-- gh-comment-id:676008785 --> @akraus53 commented on GitHub (Aug 19, 2020): Update: I improved the Firefox instructions. https://github.com/sigma67/ytmusicapi/pull/60
Author
Owner

@xplorr commented on GitHub (Aug 19, 2020):

Thx for the update!
I am currently translating my WinaYo toolkit from Google Music to Youtube Music using ytmusicapi.
(WinaYo is a command line toolkit to convert and import/sync WinAmp playlists (m3u8) to Youtube Music playLists (csv) using Python and ytmusicapi).
So far the authentication method I described above (using Chrome) seems to work.

<!-- gh-comment-id:676032011 --> @xplorr commented on GitHub (Aug 19, 2020): Thx for the update! I am currently translating my [WinaYo](https://vanbarel.eu.org/tools/winayo/index.html) toolkit from Google Music to Youtube Music using ytmusicapi. (WinaYo is a command line toolkit to convert and import/sync WinAmp playlists (m3u8) to Youtube Music playLists (csv) using Python and ytmusicapi). So far the authentication method I described above (using Chrome) seems to work.
Author
Owner

@sigma67 commented on GitHub (Aug 23, 2020):

You probably also need the "X-Goog-Visitor-Id" dont you?

Only the cookie is required since e96c4f1ca8. Even though I favor Firefox, I'll add instructions for Chromium-based browsers due to their huge market share.

<!-- gh-comment-id:678759591 --> @sigma67 commented on GitHub (Aug 23, 2020): > > > You probably also need the "X-Goog-Visitor-Id" dont you? Only the cookie is required since e96c4f1ca89131eaab4d6e445a304590fb630f7d. Even though I favor Firefox, I'll add instructions for Chromium-based browsers due to their huge market share.
Author
Owner

@xplorr commented on GitHub (Aug 23, 2020):

The cookie is enough for me, I leave all the other parms in headers_auth.json default.
ps. VISITOR_INFO1_LIVE is in the cookie. Is that what you refer to by "X-Goog-Visitor-Id"?

I use these calls:
YTMusic.get_library_playlists()
YTMusic.get_library_upload_songs()
YTMusic.get_playlist()
YTMusic.create_playlist()
YTMusic.delete_playlist()
YTMusic.edit_playlist()
YTMusic.add_playlist_items()
YTMusic.upload_song()

All work OK, except YTMusic.upload_song() doesn't seem to work. I get STATUS_SUCCEEDED, but I can't find the uploaded song when searching for it.

<!-- gh-comment-id:678760804 --> @xplorr commented on GitHub (Aug 23, 2020): The cookie is enough for me, I leave all the other parms in headers_auth.json default. ps. VISITOR_INFO1_LIVE is in the cookie. Is that what you refer to by "X-Goog-Visitor-Id"? I use these calls: YTMusic.get_library_playlists() YTMusic.get_library_upload_songs() YTMusic.get_playlist() YTMusic.create_playlist() YTMusic.delete_playlist() YTMusic.edit_playlist() YTMusic.add_playlist_items() YTMusic.upload_song() All work OK, except YTMusic.upload_song() doesn't seem to work. I get STATUS_SUCCEEDED, but I can't find the uploaded song when searching for it.
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#45
No description provided.