oSumAtrIX / DownOnSpot

🎧 A Spotify music and playlist downloader working with free Spotify accounts written in Rust
https://osumatrix.me
GNU General Public License v3.0
548 stars 45 forks source link

Error when downloading tracks - Error: Invalid state { BadDER } | <trackname> #57

Closed ncc-hyperion closed 7 months ago

ncc-hyperion commented 11 months ago

I've successfully compiled and ran on my mac, and successfully download an album (all be it with some tracks truncated/cut short) I then tried another album

I'm now getting the following error when downloading

Error: Invalid state { BadDER } | Finished download(s) in xx second(s).

ncc-hyperion commented 11 months ago

turns out that running the command using sudo makes it works. Apologies, I'm a command line novice.

However, it still seems tracks aren't fully downloaded, with lots of tracks seemingly cut short.

migo1271 commented 11 months ago

I just recovered the shortened downloads, too. It appeared with downloads after I updated to version 0.2.4. Older version 0.2.3 seems still working. On 0.2.4, reducing the "concurrent_downloads" from 4 to 1 seems to solve the problem.

ncc-hyperion commented 11 months ago

I just recovered the shortened downloads, too. It appeared with downloads after I updated to version 0.2.4. Older version 0.2.3 seems still working. On 0.2.4, reducing the "concurrent_downloads" from 4 to 1 seems to solve the problem.

Yes, I updated my concurrent_downloads to 1 too, takes longer, but its at least reliable.

Laiteux commented 10 months ago

Confirming this.

oSumAtrIX commented 10 months ago

The application is currently fully rewritten in higher quality. Locally these bugs are fixed. Currently, I am working on returning all features, such as downloading playlists, concurrency, etc. Downloading single tracks works already.

Laiteux commented 10 months ago

That's very nice to hear! Pretty excited, would you have an ETA on this? Or if the "main feature" already works, couldn't you make it a branch? Thanks a lot for your work. Will donate.

ncc-hyperion commented 10 months ago

awesome news. I've been able to get around the issue with truncated tracks by running the command in multiple terminal windows in macOS.

This amazing tool has allowed me to replace some of my lower bitrate tracks.

oSumAtrIX commented 10 months ago

@Laiteux I have pushed it: https://github.com/oSumAtrIX/DownOnSpot/tree/rewrite

Done: Download .ogg tracks Todo: Convert to mp3 (broken, probably easy fix), tagging, parallelization, handling different types of inputs (playlists, albums, artists...)

Laiteux commented 10 months ago

Thanks, got it to work. Seems all good!

Not sure if you're already aware though, but the login cache doesn't seem to be working, as I receive a login notification everytime I run the program.

Oh and --dir currently function as "output file" instead of "input directory", as you have to manually include \filename.ogg for it to output expectedly 😉

oSumAtrIX commented 10 months ago

Yes, there are a couple of things left to do, and bugs like this would be resorted along the way.

Laiteux commented 10 months ago

Any idea about why the login cache isn't working by any chance? I've looked into the code but can't seem to figure it out

oSumAtrIX commented 10 months ago

I am not sure...both clients use a cache and I do not get login notifications:

https://github.com/oSumAtrIX/DownOnSpot/blob/rewrite/src/spotify.rs#L29-L35 https://github.com/oSumAtrIX/DownOnSpot/blob/rewrite/src/download.rs#L52-L54

And from comparing with the current main branch, I can not spot any major difference as well in regards of this

oSumAtrIX commented 10 months ago

Maybe it is this: https://github.com/oSumAtrIX/DownOnSpot/blob/rewrite/src/spotify.rs#L39

Though we are getting very offtopic now, this may be moved to a separate issue.

Laiteux commented 10 months ago

Gave it a quick look myself but didn't figure it out. Not a Rust dev.

Do you think you could please have a look into this login cache issue yourself?

I know it's a WIP but I'd love being able to use it as intended already.

Let me know if you'd want me to open a new issue, tho

oSumAtrIX commented 10 months ago

I do this project on best effort basis. Once I have time I can look into it, shouldn't be too long.

Laiteux commented 9 months ago

Looked into the issue, and it seems like it was fixed there was a fix attempt by https://github.com/librespot-org/librespot/pull/1187

oSumAtrIX commented 9 months ago

What could be the reason for my not being able to reproduce the issue?

Laiteux commented 9 months ago

Check if your credentials_cache/credentials.json auth_token refreshes everytime you run - if so, you're getting reconnected everytime.

Laiteux commented 9 months ago

https://github.com/librespot-org/librespot/pull/1206

oSumAtrIX commented 7 months ago

Should be solved with 388736973582149a33c214f3634bb79644b13736.