-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
Spotify API Access: Spytify sometimes breaks on track change / Not authorized after sometimes #370
Comments
I have a screenshot of the problem now that it happened again. This is what I see when it happens: The recording continued even after stopping Spotify so with manual timing I can get the whole track anyway but then I need to reset the program anyway to continue recording EDIT at 7:36 PM GMT+2: It seems to reliably happen after almost one hour of continuous recording EDIT 2 at 7:41 PM GMT+2: This seems to be intentional behaviour from Spotify itself, the tokens for their API expire after one hour but there is a refresh token that can be used to get a new access token. I have not yet checked the source code of this program to see whether this is already handled or not. EDIT 3: It seems that the App already handles that the token is expired but for some reason it doesn't seem to work for me. Unfortunately this makes recording while being away not optimal. |
v1.8 records without any interruptions but I cannot figure out what exactly could've changed between versions which definitely breaks stuff. The only downside is that v1.8 doesn't include any album art or album title and track numbers are missing as well but that can be manually fixed (even with 1.9 I needed to edit tags manually as not everything is being filled) |
okay so I may have to upgrade my spotify-net-api to v6 thank you for your detailed report edit: i will try when I have a chance, but I'm wondering if spytify latest version stop working when recording wav file, or mp3 file but with lastfm api.. it will help target the issue |
might be related to
|
Thanks for trying to fix it, I'll pull the source code later and test if my problem is fixed. The things I noted above were some of my guesses about what could happen, I tried to find out more about it from the source code (I'm a C# dev too) but I wasn't really successfull finding the issue or at least more hints for you what exactly happens. Since I began to record I only used my account on my PC, I was careful to not use any other device that connects to spotify and possibly breaks my recordings Tasks/Threads are no problem for my PC, I have a AMD Ryzen 7 3700X so with 8 Cores and 16 Threads there should be enough resources to make sure the recording does get what it wants. I haven't tried another sound device as I only have my onboard sound card otherwise and I am mostly recording while using the PC so the virtual audio cable helps there. EDIT: I see you haven't pushed your changes yet, so unfortunately I can't test if it works now |
i got the same issue today, after recording for 10 hours, still don't know where it comes from, I was not running the app in debug, now I do |
If there's anything I could try, let me know. When I started this issue I also tried to debug a little bit, but I was clueless as well, where to debug to find anything about the issue |
two other exceptions came up, but it comes from spotifyapi.net, and apparently it was fixed in v6, so i will have to upgrade to it |
@internetfreak I just released 1.10, you may want to give it a try, I let it run from monday to friday, corrected some issues here and there and it did not got any exception for the last 2 days. |
Thanks for letting me know. Downloaded the new version and started a long enough queue to test it. Will give feedback at a later date |
Encountered another problem. Although recording works fine, the app requested API access again after one hour (when the token is expired and should be renewed). Maybe v6 of the API lib will do that but I wasn't able to grant access (browser starts "loading" indefinitely, the "window can be closed" message never appears). This causes Spytify to fall back to LastFM, effectively getting not all metadata etc. |
Okay, it happened again. Because my comment above might be confusing, here's a recap of what happens This is what I was doing
One hour later, this happens
Effectively I still have to restart recording after hour but this time due to another error. If you need me to debug something, let me know and I'll try to help as this doesn't seem to happen on your side (yet) |
Now I'm wondering if it's an issue with Spotify's recent update, they started to play multiple ads after every song. |
spytify also use the api for track status, maybe I will need to reduce the refresh rate or just use it for metadata. it's indeed to high. I never looked at my own stats |
I moved some issues to this discussion because they are all related to spotify latest update and spotify dashboard.
|
Nope, didn't add my own account to that section as this has worked before, so maybe that's the issue for me? But then it should be noticeable quite early instead of after 60 minutes which seems odd. As for the high request rate, if you run into a rate limit, Spotify will tell you that and let's you know when you can request again. I don't know if that is already handled by the API lib. |
I will try to create an app in development this week and try it, maybe in development you are limited to 25k requests or something. I will probably reduce that number quite a lot anyway, like we said, it's too high |
also I will look if refresh token is allowed in development |
Spotify itself says this in regards of the developer mode:
So according to this, refresh tokens etc should work normally. As noted earlier in this issue, 1.8 was able to record for hours (I've recorded 1.5 days worth of music at once) and I did the same with the api app as with 1.9/1.10 (only development mode; no user added to the section; only added ID & Secret to Spytify) |
ok so I will remove spotify status from the app to reduce api calls, I think that's the only difference between 1.8 and 1.9 |
I have checked out your pull request and started recording again to test it. So far it works without any issue and I'm recording for more than one hour already. I have more songs lined up (at least 5-6h of music, probably more like 10-12h) and will continue recording over night but I don't expect any issues. |
Having recorded for almost 48h continously, I can definitely say that the fix works. I have listened to a few recordings across all tracks and I couldn't find anything negative but the plus an metadata automatically fetched for me makes it incredibly easy to extend my library. Thanks for the work, closing this |
What is the bug ?
When recording a lot of tracks via the program, it sometimes breaks recording. This can be noticed because the timer within the app doesn't move anymore but Spotify itself just continues playing. It seems that even if this problem happens, the playback data is still recorded but trying to stop Spytify results in force stopping it (clicking Stop again) as it waits for the track to be finished but that never happens.
Afterwards, I often have to delete the resulting file and start over with where I lost connection to record. Also, I then need to create a complete new Spotify App to access API again, otherwise the program will ask for access but doesn't detect anything.
Track used
Happens with any track that it currently playing after a longer recording session. The disconnects happen at any time, so I can't give any good time window of how much to record before it starts breaking.
Screenshots
Will attach a screenshot if helpful and it happens again.
The text was updated successfully, but these errors were encountered: