我一直试着用spotipy来验证来制作播放列表等等。
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")我运行它,然后我得到这个:
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.我转到URL,这是一个错误,我把它发回命令行,它会出错。我不知道为什么这个库这样做,所有其他人通常做用户名,密码,客户端id和客户端机密。这一次让你因为某种原因多走了一步。如果能提供一些帮助,我们将不胜感激。我用的是所有正确的信息。我不知道这个重定向的网址是什么,也许是这引起了问题?
https://stackoverflow.com/questions/32817875
复制相似问题