Update zspotify.py

This commit is contained in:
Footsiefat 2021-10-14 19:41:49 +13:00 committed by GitHub
parent 89096db1c7
commit 97c2812522
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -230,8 +230,9 @@ def getSongInfo(songId):
disc_number = info['tracks'][0]['disc_number']
track_number = info['tracks'][0]['track_number']
scrapedSongId = info['tracks'][0]['id']
isPlayAble = info['tracks'][0]['is_playable']
return artists, albumName, name, imageUrl, releaseYear, disc_number, track_number, scrapedSongId
return artists, albumName, name, imageUrl, releaseYear, disc_number, track_number, scrapedSongId, isPlayAble
@ -339,15 +340,17 @@ def get_album_name(access_token, album_id):
#Functions directly related to downloading stuff
def downloadTrack(track_id_str: str, extra_paths = ""):
global rootPath, skipExistingFiles
track_id = TrackId.from_base62(track_id_str)
artists, albumName, name, imageUrl, releaseYear, disc_number, track_number, scrapedSongId = getSongInfo(track_id_str)
artists, albumName, name, imageUrl, releaseYear, disc_number, track_number, scrapedSongId, isPlayAble = getSongInfo(track_id_str)
songName = artists[0] + " - " + name
filename = rootPath + extra_paths + songName + '.mp3'
skipExistingFiles
if not isPlayAble:
print("### SKIPPING:", songName, "(SONG IS UNAVAILABLE) ###")
else:
if os.path.isfile(filename) and skipExistingFiles:
print("### SKIPPING:", songName, "(SONG ALREADY EXISTS) ###")
else: