jwallet / spy-spotify

🎤 Records Spotify to mp3 without ads and adds media tags to the files 🎵
https://jwallet.github.io/spy-spotify/
MIT License
2.13k stars 139 forks source link

Unable to record unless web client running #394

Closed Vox-Ludus closed 2 years ago

Vox-Ludus commented 3 years ago

What is the bug ? I was previously able to record perfectly normally using 1.10.1, when in the middle of recording I get an error saying "Spotify API Failed" and it fell back to LastFM. Since then I am unable to record using the Spotify API unless the web player is running. If I start recording without the web player open I get the same error 5 seconds later. If I start recording while the web player is open it records from the desktop client without any issue. If I close the web player while recording 5 seconds later I get the same error as before.

Through this the web player is not playing anything and shows "Listening on DESKTOP" as it normally would. The web and desktop clients eventually get out of sync with each other. With the desktop continuing to play and record normally and the web sometimes stuck on something like "59m59s/3m25s" on a track played hours ago. This doesn't seem to matter as long as the web player is open.

I tried 1.10 and 1.9, it was the same story.

For now it's working. The web player having to be open is a minor inconvenience. I'm more curios as to why this is happening.

Track used Track didn't matter. I attempted with various artists, and even some I had already successfully recorded.

Screenshots Untitled Untitled1

jwallet commented 2 years ago

I only use Spotify Desktop app so I never get the notification "Listening on DESKTOP", but I heard other people complaining about this issue, you probably found the cause. Thanks for the report. Otherwise, I don't know why it needs to have a tab open on the web player, it might be a web token expiration from SpotifyAPI, Spytify uses the web token, and the desktop-app might use another way to authenticate itself, but I don't know yet.

jwallet commented 2 years ago

Do you have more than one Spotify account? If so this issue also happens if you are connected to SpotifyDesktop with Account1, but authenticate to SpotifyAPI with Spytify to your Account2, so to this app will need your Account2 current playback, if nothing plays it will throw this error. So I think it let you record since your web app was playing the same playback as your desktop app but on a different account, sounds familiar?

ItsBernd commented 2 years ago

Installing the Spotify App from the Microsoft Store fixed it for me.

jwallet commented 2 years ago

thanks for the info