4
我一直在试图与spotipy验证,使播放列表等Spotipy尝试验证通过OAuth
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.
我去该网址,这是一个错误,我把它发回到命令行,它的错误。我不知道为什么这个库这样做,所有其他人通常会做用户名,密码,客户端ID和客户端密码。出于某种原因,这一个让你走了一步。一些帮助将不胜感激。我正在使用所有正确的信息。我不确定这个重定向url是什么,也许这是导致问题的原因?
尝试了这一点,我得到了一个页面,用于说明错误,我将网址粘贴回去,它说不好的请求。你必须有一个高级账户才能访问api或其他东西吗? – Eigenvalue
不,我不。你是否设置了本地服务器?(localhost) – woryzower
我不确定你的意思。为什么你需要一个本地服务器? – Eigenvalue