-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New YTMusic Cookie Format? #195
Comments
You should update your instance of Multi-Scrobbler...the last year of updates has really improved MS's stability and added a ton of features including knowing what version you are on. However I am able to reproduce on current MS versions as well.
The endpoint is for MS uses another library to facilitate this communication so it's not something I can immediately fix or investigate but it looks like other projects relying on the endpoint are having issues as well. It may be that Youtube Music hanged their undocumented API endpoints or there is an internal issue that could be resolved. |
Coming from #199. Here are my logs, exactly the same as @FoxxMD:
|
Mostly talking to myself here but I've confirmed that the liked music endpoint still works when using oauth authentication with the original ytmusicapi python library. Using browser authentication, which is what yt-music-ts-api (MS) uses, is what is failing when trying to hit the endpoint. |
@jrlebbs @bockbilbo please try out the new YTM auth in #203 and let me know if this fixes things for you -- |
@FoxxMD the new pr is not working, I am getting an exception for a missing package:
|
Please pull the latest PR image and see if that works, thanks |
I have tried pr-203 and pr-205. The logs from my previous message are for pr-203. pr-205 was not even booting. What latest PR image do you refer to? |
Please try re-pulling |
Thanks @FoxxMD . I have tried again, and have confirmed the version. The tool is prompting me a code to Re-authenticate into Youtube Music, but redirects to an internal website "/api/source/auth?name=Youtube%20Music&type=ytmusic" that returns "Internal Server Error". Here are the logs from the app in Docker:
My guess is that i should have been redirected to a youtube page to enter the code to authenticate myself. Do i need to enter some kind of Youtube developer API token in the multi-scrobbler configs? |
Actually.. I was able to connect to youtube music and scrobble music played from their website! Scrobbling is not working though when I play music from the Youtube Music app. Is that behavior expected? I found this log on the tool:
I used the google.com/device url to make it work! I guess that the redirect url link in the app needs review? |
Ok, I've got 0.8.5 installed. When I run npm start (before I get 203 merged), this happens: MINGW64 ~/multi-scrobbler-0.8.5
'NODE_ENV' is not recognized as an internal or external command, |
Yea so I was able to do the same, and it does work with mobile app for me. But I noticed that it "discovered" 20 tracks, which were the last ones I had played before setting up the scrobbler. If I try to play those, it doesn't scrobble, but anything not on that list scrobbles. However, they get added to that list and don't scrobble anymore if I replay the song. Is this intended an behavior? |
@MyNameHand I have experienced the same behavior. After my first run, multi-scrobbler got the 20 Youtube Music plays before setting up the scrobbler, but then did not update despite refreshing every 10 seconds. A day later, it refreshed some 10 songs I played from my google speaker, but then stopped detecting more after that. @FoxxMD I wonder if there is a problem with the code part that retrieves and refreshes the cache from Youtube Music. Or could it be a problem with the google url used to get the data? |
Yeah I need to do some more due diligence on how the data returned looks compared to the previous cookie method. The current changes in #203 were just to see if oauth would work (At all). Will look into the behavior ya'll have described this week. |
Looks like YTM made other changes other than blocking cookie-based retrival of the history endpoint. The way it returned data it used to include all instances of played songs (without a timestamp) but they were at least ordered based on when they were played IE:
Now, it's removing the earlier play and putting it at the front of the list:
Since YTM doesn't provide timestamp and the api doesn't allow tracking the player in realtime the logic used to determine new plays is dependent on the history order being "valid" with some heuristics. The new behavior is causing it to throw away the remove-and-bump differences which only affects tracks that are played again within YTM's history window. |
Should fix new way YTM orders recent history #195
Please update to the latest image of |
It works!!! I have just played song A, then song B, then song A again from the browser, and the three were recorded! :) I will continue to test in the next few days and get back if there is any problem. Thanks a lot @FoxxMD |
Alright... so.. after the test above, i tried using Youtube Music on my phone, and the song I played was scrobbled. However, a song I played a few days when testing was also scrobbled with the current timestamp. |
@FoxxMD, I've got pr-203 pulled into docker, but when I try to run, I get the error below. Any thoughts on what I can do to fix? docker run -v "$(pwd)/config:/config" -p 9078:9078 foxxmd/multi-scrobbler:pr-203 |
No, I'm not using portainer. Just pulled the image and ran it with the commands. |
I'm also fine just to wait until 203 is merged with main and pull the new main version, since it seems like other people's testing is working. |
feat(youtube)!: Use oauth-based api library for better stability
This is available on the |
@FoxxMD I am sorry for the late reply, I have been out for the last couple of weeks. Thanks for continuing working on the request. I have tested the latest foxxmd/multi-scrobbler:edge docker image (master-eb26ee0) and have noticed that I am being asked to re-authenticate into YoutubeMusic every time I restart the container. Is this an expected behavior? Also, I want to verify if the problems I reported a few weeks back are still happening. I will reply back with findings. For reference, below are my YTM settings in the config.json file. I don't think the cookie is needed anymore, right?
|
I was not able to reproduce the problem I reported 2 weeks ago about songs being re-scrobbled. If I see it happening again, I will open a new issue to address it, but I am guessing that the changes made by @FoxxMD might have fixed it. Also, I just made a test of playing some music on my browser, phone and nest hub, and everything worked as expected. The debug logs are also nice to see, the history diff is useful to see how MS is working in the backend.
|
This is the last pending question I have. I wonder if other's have the same problem. I have verified that the youtubei_oauth_credentials directory containing the oauth credentials has the right permissions. Is there anything else I should check? |
It should not be asking you to reauthenticate everytime. Can you post startup logs? |
Here you go, there is a 400 error triggering the reauthentication request:
|
Thanks for the details, I'll see if i I can reproduce this |
@FoxxMD, potentially new problem. I was having the same issue as @bockbilbo with my creds not saving between sessions. Not a big deal. But now, something keeps crashing when trying to auth with the new approach. I can reproduce every time I try to auth YTM running the pr-203 image. Please let me know how I can help troubleshoot this |
@FoxxMD I have the same problem as @jrlebbs. I cannot longer re-auth after the server restarts when using master-eb26ee0. Looking at the logs, an exception is happening. First, I restart the service:
Youtube Music is not working, the source needs action on the dashboard. I open the dashboard and click on (Re)authenticate
Next, since the Google auth code is not showing up in the dashboard, I have to refresh the website to see it. Once it's displayed, I click on the (Re)authenticate link.
Next, I authenticate on the Google device page.
Next, I refresh the dashboard and click start on the dashboard to initiate the YTMusic source.
This causes MS to restart. As you can see, many exceptions are being thrown along the process. |
I have also tried with multi-scrobbler:pr-203 and I get the same behavior. The moment I click "Start" on the YTMusic dashboard section after having entered the auth code in Google, MS crashes and restarts. |
For everyone having auth and history fetching issues: please try out the new authentication methods detailed in #236 using the docker image If you try out the new docker image please post any issues you have with it in the issue for #236 instead of this one so I can better keep track of things, thanks. |
Thanks @FoxxMD, I moved to the new requested thread. |
Accidentally closed, but this should be fixed in The only person I haven't heard from is @MyNameHand and @UditDey please try using You will probably need to get new cookies. After updating your image open Docs on your instance and read the new YT Music configuration section for cookies/oauth to get started. Also check out the FAQ for new YTM troubleshooting directions.. If this works but you are still having scrobbling issues let's open a new issue for it or use one of the existing, open issue. |
Hi, ill give |
no luck, I opened another issue a while back and I'm getting the same error message as what i posted in that issue |
Did you get new cookies? Or try the oauth approach? Can you please post logs as well as a log/screenshot showing the version of MS that is running? |
Fixed in v0.9.0 |
Please check the FAQ before submitting a bug report.
Describe the bug
YouTube Music stopped authenticating as a source about 3 days ago. Logged in following the guide and the cookie now starts with "HSID" instead of "SID"
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The cookie should auth YTMusic.
Logs
If possible reproduce the issue with debug logging ON
Versions (please complete the following information):
Provide version information for any related sources/clients.
-- running on windows
Additional context
I have tried several ways, reboots, etc. to get this to work. I suspect the cookie format has changed and I'm happy to provide more cookie details, just unsure of what's secure or not to be careful with.
Happy to help in any way!
The text was updated successfully, but these errors were encountered: