Synchronize Apple Music library with Spotify. Only works with playlists. Hence, you need playlists in your Apple Music library for these scripts to run. To sync your entire library, create a playlist that holds all your songs.
- Complete control over your data (data is only processed by Spotify's API, no third party)
- Supports incremental syncing by keeping track of what has been synced before
- Provides detailed reports on the syncing effectiveness by logging song matches and their associated similarity scores. See example below:
Apple Song Name | Apple Artist | Apple Album | Spotify Song Name | Spotify Artist | Spotify Album | Spotify Track ID | Match Score | Song Match Score | Artist Match Score | Album Match Score |
---|---|---|---|---|---|---|---|---|---|---|
Caruso | Fiorella Mannoia | A te (Special Edition) | Caruso | Fiorella Mannoia | A te | 2kWftUZ8PxLQtRvrHX3cIe | 0.93 | 0.83 | 0.88 | 0.2 |
- Successfully matches various edge cases, such as artist collaborations (e.g.
&
in artist name orfeat.
in song name)
These steps have been validated with the website's version as of 2021-01-17.
- Go to https://developer.spotify.com/dashboard/ and create an account
- Click on "CREATE AN APP"
- Provide the app name & description of your choice, tick the terms of service and click "CREATE"
- Click on "EDIT SETTINGS"
- Under "Redirect URIs" put
http://localhost:9000/callback/
andhttp://localhost:8090
- On the left side of the dashboard, underneath the description of your app, you will find your apps' "Client ID". Take note of it as you will need it in step 2.2.
- Below your "Client ID" you will find an option to "SHOW CLIENT SECRET", click on it and take note of the value as you you will need it in step 2.2.
The below instructions are for Linux or MacOS.
git clone git@github.com:calyptis/MusicSync.git
cd MusicSync
Install pinned development dependencies using:
pip install -r requirements.txt
If you are using Conda to manage your Python environments:
conda env create -f environment.yml
Alternatively, if you are using an existing environment, you can install the module in editable mode, which includes only minimal dependencies:
pip install -e .
In the folder credentials
create a file named credentials.json
where you specify the configurations you obtained in step 1.6 & 1.7.
The file has the following structure:
{
"client_id": "{your_client_id}",
"client_secret": "{you_client_secret}",
"redirect_uri": "http://localhost:9000/callback/",
"redirect_flask_uri": "http://localhost:8090"
}
replace your client ID with value from step 1.6 and your client secret from step 1.7.
Get Apple Music info:
- open Music app (macOS or Windows, tested with app version
1.2.5.7
) - Go to
File -> Library -> Export Library...
- Save file as
Library.xml
indata/apple_music/
Now, playlists can be synced.
python -m music_sync.main
- If Apple Music library has not yet been parsed:
python -m music_sync.apple_music.main
- Sync a specific playlist
python -m music_sync.spotify.main --name "Apple Music Playlist Name"