I am trying to check with spotipy to create playlists, etc.
import spotipy
import spotipy.util as util
class buildPlayList():
def __init__(self,name):
scope = 'playlist-modify-public'
self.username=name
token = util.prompt_for_user_token(self.username, scope,client_id='', client_secret='',redirect_uri='http://example.com/callback/')
self.sp = spotipy.Spotify(auth=token)
print self.sp.current_user()
def make_and_build(self):
pass
x=buildPlayList("myname")
I run it and then I get the following:
User authentication requires interaction with your
web browser. Once you enter your credentials and
give authorization, you will be redirected to
a url. Paste that url you were directed to to
complete the authorization.
I go to the url and this is a mistake, I send it back to the command line and errors. I have no idea why this library does this, everyone else usually uses a username, password, client ID and client secret. For some reason, this forces you to take an extra step. Some help would be appreciated. I use all the correct information. I'm not sure what the redirect is for the URL, maybe what is causing the problem?
source
share