sigma67 / ytmusicapi

Unofficial API for YouTube Music
https://ytmusicapi.readthedocs.io
MIT License
1.76k stars 209 forks source link

Getting 401 error while creating playlist #680

Closed FaizAlam closed 1 week ago

FaizAlam commented 1 week ago

I am exploring ytmusicapi and facing issue while creating playlist. I am using browser authentication and I have stored the json in a file named browser.json. The format of the content is same as provided in the manual file creation documentation. But when I try to search for songs using the same object, it works perfectly fine. So I don't think its an issue related to Cookie.

Describe the bug Getting ytmusicapi.exceptions.YTMusicServerError: Server returned HTTP 401: Unauthorized. while creating playlist. Code: Screenshot 2024-11-17 125619

browser.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": "0", "x-origin": "https://music.youtube.com", "Cookie" : "<COOKIE GOES HERE>" }

Respose: Screenshot 2024-11-17 125750

To Reproduce Steps to reproduce the behavior: Try the code provided in the above screenshot

Please let me know how can i resolve this, I am working on my personal project and would love any kind of help. Thanks a lot

sigma67 commented 1 week ago

Please re-authenticate. Your credentials are not/no longer working