【发布时间】:2021-05-27 13:55:51
【问题描述】:
下面是我的代码。我正在尝试获取令牌,以便进行身份验证。遇到问题,因为我没有被重定向到另一个 URL。我已经将 URI 输入到我的 Spotify 开发者应用程序中。不知道出了什么问题,或者我输入的 URL 是否不正确。输入为:https://www.google.com/。另外,目前正在使用 google collab,如果这有影响的话。
#client id and secret for my application
client_id = 'id' # hidden for now
client_secret= 'secret' # hidden for now
scope = 'user-library-read'
if len(sys.argv) > 1:
username = sys.argv[1]
else:
print("Usage: %s username" % (sys.argv[0],))
sys.exit()
auth_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
sp = spotipy.Spotify(auth_manager=auth_manager)
token = util.prompt_for_user_token(username, scope, client_id= client_id, client_secret=client_secret, redirect_uri='https://www.google.com/')
【问题讨论】:
标签: python authentication oauth-2.0 spotify