Migrate your playlists from Amazon Music to Spotify using a simple Flask web interface.
Navigate to developer.spotify.com and create a new app. Use this as the callback URL:
http://127.0.0.1:5000/callback
Retrieve your client id and client secret for later use.
Currently, the Amazon Music API won't let us create applications for OAuth ourselves without them needing to be approved by Amazon. Since we only want to perform a one-time migration, we can obtain an OAuth token via Amazon's own interactive API reference, hence eliminating the need for us to be able to create our own application.
Navigate to dashboard.music.amazon.dev
and press the button Get Token
in order to retrieve a valid token.
Login using your Amazon Music profile's credentials when prompted.
Copy the resulting token and set it as environment variable as described in
the next step. Make sure to also copy the x-api-key
value as provided in
the example curl
command given on Amazon's interactive API reference as well.
Next set these environment variables. Get the client id and client secret from the spotify app you have just created.
# client id and client secret of your spotify application
export SPOTIFY_CLIENT_ID=XXX
export SPOTIFY_CLIENT_SECRET=XXX
# token and x-api-key from the interactive amazon API reference
export AMAZON_TOKEN=XXX
# example: amzn1.application.72b599tbc0b549339095eb1234c3c7d1
export AMAZON_X_API_KEY=XXX
Install the dependencies using pipenv:
pipenv install
Start the flask server like this:
pipenv run python -m flask run
You can then open the webinterface under the URL http://127.0.0.1:5000
.
Press the button for authenticating at Spotify before running any migration.
Errors will be printed in the Flask app's log, if any occurred.
Tip | |
---|---|
š” | Try to verify the status code of the reponses from the Amazon/Spotify API using the log before opening an issue. Refreshing the credentials will most likely resolve the issue. |
The following limitations exist:
30min
. Keep that in mind when running migrations.