I'm trying to use the Spotipy library to pull user tracks and make a playlist. Each function works individually (getTracks, makePlaylist); however, they require different scopes.
def generate_token(scope):
token = util.prompt_for_user_token(
username='al321rltkr20p7oftb0i801lk',
scope=('user-library-read','playlist-modify-private'),
client_id='0e7ea227ef7d407b8bf47a4c545adb3c',
client_secret='267e96c4713f46d4885a4ea6a099ead4',
redirect_uri='http://www.google.com')
return token
This returns the error "AttributeError: 'tuple' object has no attribute 'split'" I also get errors when I try to send the two scopes as a list. Any ideas on how to fix this?
scope
should be a single string, not a tuple.
scope='user-library-read playlist-modify-private'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With