the-batfish / spotify-downloader

Download songs,playlists and even albums from spotify within a matter of seconds in a variety of different formats like m4a,mp3,wav and even flac with spotify downloader
GNU General Public License v3.0
298 stars 29 forks source link

Song stops downloading out of the blue #23

Open jackhope1169 opened 10 months ago

jackhope1169 commented 10 months ago

the songs download up to around 20 to 30 songs then it stops both in the exe version and python, when closed and retried to download again, it skips the songs it already downloaded, then when it reaches a new song to download, it doesn't work again.

Based on the error logs, it seems the main issue is that some of the songs being processed do not have an "isrc" key in their "external_ids" dictionary.

Specifically, this line is causing errors:

Copy code

isrc_code = str(song["external_ids"]["isrc"].replace("-", "")) When it tries to access song["external_ids"]["isrc"], it is raising a KeyError because some songs do not have an "isrc" entry.

Some solutions you could try:

Wrap that line in a try/except block to catch the KeyError and handle it gracefully: Copy code

try: isrc_code = str(song["external_ids"]["isrc"].replace("-", "")) except KeyError:

handle case where isrc is missing

isrc_code = None

Check if "isrc" is in external_ids before trying to access it: Copy code

if "isrc" in song["external_ids"]: isrc_code = str(song["external_ids"]["isrc"].replace("-", "")) else:

handle missing isrc

Pass over songs missing the isrc instead of erroring: Copy code

if "isrc" not in song["external_ids"]: continue # skip this song The key thing is some songs don't have that metadata, so you need to handle that case to avoid errors.

Let me know if any part of the diagnosis or suggestions need more clarification!

rickyrorton commented 10 months ago

This project is deprecated kindly use other downloaders