Spotify中的错误。出问题了,请重试或查看我们的帮助区域

时间:2019-02-09 15:58:29

标签: python spotify spotipy

我目前正在使用python开发应用程序,在进行身份验证时,它向我发送错误消息。

import sys
import spotipy
import spotipy.util as util

scope = 'user-library-read'

if len(sys.argv) > 1:
    username = sys.argv[1]
else:
    print "Usage: %s username" % (sys.argv[0],)
    sys.exit()

token = util.prompt_for_user_token(username, scope)

if token:
    sp = spotipy.Spotify(auth=token)
    results = sp.current_user_saved_tracks()
    for item in results['items']:
        track = item['track']
        print track['name'] + ' - ' + track['artists'][0]['name']
else:
    print "Can't get token for", username

Spotify error

1 个答案:

答案 0 :(得分:0)

我会检查callback URL-确保已在Spotify开发人员门户上的应用程序中对其进行了设置。

您需要具有有效的URL,Auth才能起作用。如果您的应用使用尾随/,请确保该尾随var value = getComponent("wi_Reason").getSubmittedValue();。确保根据您的环境设置正确设置了http / https。

有关更多信息,您可以按照以下步骤操作:https://developer.spotify.com/documentation/web-api/quick-start/