Skip to content

Commit 1de7048

Browse files
committed
Fix some (unavailable) songs trying to be downloaded
1 parent 5404cca commit 1de7048

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

zspotify/app.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def client(args) -> None:
4848

4949
if args.liked_songs:
5050
for song in get_saved_tracks():
51-
if not song[TRACK][NAME]:
51+
if not song[TRACK][NAME] or not song[TRACK][ID]:
5252
Printer.print(PrintChannel.SKIPS, '### SKIPPING: SONG DOES NOT EXIST ON SPOTIFY ANYMORE ###' + "\n")
5353
else:
5454
download_track('liked', song[TRACK][ID])
@@ -85,14 +85,16 @@ def download_from_urls(urls: list[str]) -> bool:
8585
enum = 1
8686
char_num = len(str(len(playlist_songs)))
8787
for song in playlist_songs:
88-
if not song[TRACK][NAME]:
88+
if not song[TRACK][NAME] or not song[TRACK][ID]:
8989
Printer.print(PrintChannel.SKIPS, '### SKIPPING: SONG DOES NOT EXIST ON SPOTIFY ANYMORE ###' + "\n")
9090
else:
91-
download_track('playlist', song[TRACK][ID], extra_keys={
92-
'song_name_playlist': song[TRACK][NAME],
91+
download_track('playlist', song[TRACK][ID], extra_keys=
92+
{
93+
'playlist_song_name': song[TRACK][NAME],
9394
'playlist': name,
9495
'playlist_num': str(enum).zfill(char_num),
95-
'playlist_id': playlist_id
96+
'playlist_id': playlist_id,
97+
'playlist_track_id': song[TRACK][ID]
9698
})
9799
enum += 1
98100
elif episode_id is not None:

0 commit comments

Comments
 (0)