mirror of
https://github.com/THIS-IS-NOT-A-BACKUP/zspotify.git
synced 2024-11-29 19:24:34 +01:00
add check premium function in preperation
This commit is contained in:
parent
090e27dbdf
commit
a52118b7d8
10
zspotify.py
10
zspotify.py
@ -234,8 +234,16 @@ def getSongInfo(songId):
|
|||||||
|
|
||||||
return artists, albumName, name, imageUrl, releaseYear, disc_number, track_number, scrapedSongId, isPlayAble
|
return artists, albumName, name, imageUrl, releaseYear, disc_number, track_number, scrapedSongId, isPlayAble
|
||||||
|
|
||||||
|
def checkPremium(access_token):
|
||||||
|
headers = {'Authorization': f'Bearer {access_token}'}
|
||||||
|
resp = requests.get('https://api.spotify.com/v1/me', headers=headers).json()
|
||||||
|
if resp["product"] == "premium":
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Functions directly related to modifying the downloaded audio and its metadata
|
#Functions directly related to modifying the downloaded audio and its metadata
|
||||||
def convertToMp3(filename):
|
def convertToMp3(filename):
|
||||||
print("### CONVERTING TO MP3 ###")
|
print("### CONVERTING TO MP3 ###")
|
||||||
|
Loading…
Reference in New Issue
Block a user