oSumAtrIX/DownOnSpot

Fast downloads freeze the process (please add a delay)

Roolio247 opened this issue ยท 13 comments

When downloading a playlist without the MP3 conversion the process gets stuck sometimes, almost every time at some point (the completion % freezes forever). It does not happen when the conversion option is enabled. My guess is that the conversion allows for a little delay between two downloads.

Maybe adding a small delay beween two successive track downloads could do the trick?

I can not reproduce, please include reproduction steps.

sure: note that i am using a paid spotify account

using windows powershell in release directory:
.\down_on_spot.exe https://open.spotify.com/playlist/5P0I08xQbvhzdRpZnrory9?si=570a78bc5b344d7f

settings:
"refresh_ui_seconds": 1,
"downloader": {
"concurrent_downloads": 1,
"quality": "Q320",
"path": "D:\Backup\Musique\DownOnSpOGG\_LAST",
"filename_template": "%title%",
"id3v24": false,
"convert_to_mp3": false,
"separator": ", ",
"skip_existing": true
}

At some random point a song download freezes and only interrupting the process can be done

For testing purposes, could you try this branch https://github.com/oSumAtrIX/DownOnSpot/tree/rewrite. It can only download songs for now.

Sure i'll try it and let you know. However if it can only download one song at the time the issue can't be reproduced. Only happens to me when a few songs are cued

I forked the script from hammadxp to work with the current REWRITE branch of DownOnSpot.
This script allows to download entire playlists instead of doing it manually (as the playlists links are not currently supported by the rewrite). In the background, it simply parses the playlists and use DownOnSpot to download each song.

Note that I did not optimized the script at all, I just made some quick modifications for it to work. I'll maybe update it later but don't count on it.

You can find my fork here: https://github.com/01110111000001/unify-for-spotify

Implementing downloads of playlists is something I can easily implement, but I haven't had the time to yet, nor do I know if this branch actually fixes said issue, if I download concurrently. Stay tuned.

Implementing downloads of playlists is something I can easily implement, but I haven't had the time to yet, nor do I know if this branch actually fixes said issue, if I download concurrently. Stay tuned.

No problem! I'm really grateful for having an app that actually downloads from Spotify. So thanks @oSumAtrIX !

I replied here cause I modified this sript a month ago and by reading this issue I thought it could be useful so I shared it.

For testing purposes, could you try this branch https://github.com/oSumAtrIX/DownOnSpot/tree/rewrite. It can only download songs for now.

So I did try and without surprise i could not replicate. Maybe by implementing cueuing downloads we could investigate further.

In the meantime i'll be using the approach proposed by @01110111000001, fetching individual songs URLs from playlists using the Spotify API using python (I'm not quite there yet rust-wise).

So i was fiddling with the spotify API myself and came accross this limitation which might -in my uneducated and humble opinion though- be related to the issue:
https://developer.spotify.com/documentation/web-api/concepts/rate-limits

Shouldn't be hitting any rate limit, you can inspect the network traffic for any rate limit response codes though.

Looking a bit more into it, with logs enable (export RUST_LOG=DEBUG) , and concurrent downloads, it seems the error is related to some channel logic in librespot_audio::fetch::receive:

(on current master branch, downloading an album). Will look into this

[2024-02-14T04:07:10Z ERROR librespot_core::channel] channel error: 2 1
[2024-02-14T04:07:10Z WARN  librespot_audio::fetch::receive] Error from channel for data receiver for range 9711616 (+16384).
[2024-02-14T04:07:10Z ERROR librespot_core::channel] channel error: 2 1
[2024-02-14T04:07:10Z WARN  librespot_audio::fetch::receive] Error from channel for data receiver for range 9326592 (+16384).
[2024-02-14T04:07:10Z ERROR librespot_core::channel] channel error: 2 1
[2024-02-14T04:07:10Z WARN  librespot_audio::fetch::receive] Error from channel for data receiver for range 9641984 (+16384).
[2024-02-14T04:07:10Z ERROR librespot_core::channel] channel error: 2 1
[2024-02-14T04:07:10Z WARN  librespot_audio::fetch::receive] Error from channel for data receiver for range 9326592 (+16384).
[2024-02-14T04:07:10Z ERROR librespot_core::channel] channel error: 2 1
[2024-02-14T04:07:10Z ERROR librespot_core::channel] channel error: 2 1

FYI: if i remove concurrency and do one song at a time, it works (even for the whole album).

I am unsure if this is related to librespot thought. It might be worth a shot to open an issue there if you think that makes sense.