the-batfish/spotify-downloader

Song stops downloading out of the blue

jackhope1169 opened this issue · 1 comments

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!

This project is deprecated kindly use other downloaders