import spotipy
import spotipy.util as util
import json
token =util.oauth2.SpotifyClientCredentials(client_id, client_secret)
cache_token = token.get_access_token()
spotify = spotipy.Spotify(cache_token)
tids = []
track_list = []
artist_list = ['Taylor Swift','Linkin Park','Charlie Puth']
for artist in artist_list:
print artist
results = spotify.search(q=artist,limit = 50)
for i, t in enumerate(results['tracks']['items']):
tids.append(t['uri'])
这给我一个像这样的错误:
SpotifyException:http状态:400,代码:-1 - Link
无效请求
知道为什么吗?
这是我第一次发布到stackoverflow,所以请原谅我,如果我在帖子的格式上犯了任何错误。