Skip to content

Commit

Permalink
Spotify tracks that are "None" are skipped now. #11
Browse files Browse the repository at this point in the history
  • Loading branch information
linsomniac committed Jan 15, 2024
1 parent dcb170d commit e709367
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spotify2ytmusic/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ def copier(
print(f"== Spotify Playlist: {src_pl_name}")

for src_track in src_pl["tracks"]:
if src_track["track"] is None:
print(
f"WARNING: Spotify track seems to be malformed, Skipping. Track: {src_track!r}"
)
continue

try:
src_album_name = src_track["track"]["album"]["name"]
src_track_artist = src_track["track"]["artists"][0]["name"]
Expand Down

0 comments on commit e709367

Please sign in to comment.