I put all awful gen-z non-music your friends shared in telegram into a Spotify playlist so you don't have to.
- Make sure Python 3.6+ & AWS CDK are installed.
pip install -r requirements.txt
cdk bootstrap && cdk deploy --all
- Create
spotify/oauth2
secret in Secrets Manager:
{
"client_id": "",
"client_secret": "",
"redirect_uri": "http://localhost:9090",
"scope": "playlist-modify-public"
}
- Create
/spotify/user_id
parameter in Parameter Store. - Create
/spotify/playlist_id
parameter in Parameter Store. - Test API locally in Python Console or run the lambda to get .cache file with the token. Put the contents of the file into
token_cache
DynamoDB table as DynamoDB JSON string:
{
"name": "token_info",
"value": {
'access_token': {'S': '<TOKEN>'},
'expires_at': {'N': '<EXPIRES_AT>'},
'expires_in': {'N': '3600'},
'refresh_token': {'S': '<REFRESH_TOKEN'},
'scope': {'S': 'playlist-modify-private playlist-modify-public'},
'token_type': {'S': 'Bearer'}
}
}