Open zhammer opened 6 years ago
(venv) Zachs-MBP:playlist-souffle zhammer$ sls invoke local -f souffle-playlist -d "{\"headers\": {\"Authorization\": \"Bearer $ACCESS\"}, \"body\": \"playlistUri=spotify%3Auser%3Azachthehammer%3Aplaylist%3A5UwmRyJAt4LyitmWXITjJw&shuffleBy=album\"}"
Fetch user id: 0.6363968849182129
Fetch playlist: 1.521245002746582
Fetch Related tracks: 4.676896095275879
Souffle function: 0.0032722949981689453
{
"statusCode": 500,
"body": "{\"message\": \"Encountered Spotify api error. Message: \\\"https://api.spotify.com/v1/users/zachthehammer/playlists:\\n API rate limit exceeded\\\".\"}"
}
I can get several albums with one request https://developer.spotify.com/documentation/web-api/reference/albums/get-several-albums/ but can't get the top tracks of several aritsts with one request unfortunately.
Update: this isn't actually timing out, basically using concurrent request threads w/ enough requests causes rate limit to be exceeded, which throws an exception. (spotipy already has some built in retry logic).
this could be resolved by not doing concurrent fetches, but that'd be super slow. will keep looking into solutions