mirror of
https://github.com/THIS-IS-NOT-A-BACKUP/zspotify.git
synced 2025-07-01 07:13:14 +00:00
Update zspotify.py
This commit is contained in:
parent
89096db1c7
commit
97c2812522
11
zspotify.py
11
zspotify.py
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user