mirror of https://github.com/afkcodes/zspotify.git
Fix some (unavailable) songs trying to be downloaded
This commit is contained in:
parent
5404ccaf9d
commit
1de70483fe
|
@ -48,7 +48,7 @@ def client(args) -> None:
|
|||
|
||||
if args.liked_songs:
|
||||
for song in get_saved_tracks():
|
||||
if not song[TRACK][NAME]:
|
||||
if not song[TRACK][NAME] or not song[TRACK][ID]:
|
||||
Printer.print(PrintChannel.SKIPS, '### SKIPPING: SONG DOES NOT EXIST ON SPOTIFY ANYMORE ###' + "\n")
|
||||
else:
|
||||
download_track('liked', song[TRACK][ID])
|
||||
|
@ -85,14 +85,16 @@ def download_from_urls(urls: list[str]) -> bool:
|
|||
enum = 1
|
||||
char_num = len(str(len(playlist_songs)))
|
||||
for song in playlist_songs:
|
||||
if not song[TRACK][NAME]:
|
||||
if not song[TRACK][NAME] or not song[TRACK][ID]:
|
||||
Printer.print(PrintChannel.SKIPS, '### SKIPPING: SONG DOES NOT EXIST ON SPOTIFY ANYMORE ###' + "\n")
|
||||
else:
|
||||
download_track('playlist', song[TRACK][ID], extra_keys={
|
||||
'song_name_playlist': song[TRACK][NAME],
|
||||
download_track('playlist', song[TRACK][ID], extra_keys=
|
||||
{
|
||||
'playlist_song_name': song[TRACK][NAME],
|
||||
'playlist': name,
|
||||
'playlist_num': str(enum).zfill(char_num),
|
||||
'playlist_id': playlist_id
|
||||
'playlist_id': playlist_id,
|
||||
'playlist_track_id': song[TRACK][ID]
|
||||
})
|
||||
enum += 1
|
||||
elif episode_id is not None:
|
||||
|
|
Loading…
Reference in New Issue