Skip to content

Playlists migration between accounts of some music services (Spotify2Tidal, Tidal2Tidal, Spotify2Spotify)

Notifications You must be signed in to change notification settings

nchiarappa/spotify-tidal-migration

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spotify2Tidal, Spotify2Spotify, Tidal2Tidal Account Migration

A suite of helpful (to me) functions to transfer music (i.e. playlists) from Spotify to Tidal, and vice versa, using tidalapi and spotipy. The suite also helps copying playlists and tracks between two accounts of the same service (i.e. between two TIDAL accounts or between two Spotify accounts). Because Tidal does not have a public-facing API, if they change their URLs or requirements, this will break. Feel free to submit a bug report if it does and I'll try to fix it if I can.

Things you can do

delete_all_tidal_playlists()

Delete all your tidal playlists.

move_all_tidal_playlists_to_spotify()

Move all your tidal playlists to spotify.

move_one_tidal_playlist_to_spotify(playlist_id)

Move one of your tidal playlists to spotify. Takes a playlist ID

move_all_spotify_playlists_to_tidal()

Move all of your spotify playlists to tidal.

move_favourites_from_spotify_to_tidal()

Move all your favourites/liked/saved tracks from spotify to your favourites tracks in tidal.

move_discover_weekly_from_spotify_to_tidal()

Move a discovery weekly playlist on spotify to tidal. A minimal version of this repository that calls this function and is configured to run on my server is in this branch.

copy_tidal_playlists_to_another_tidal_account()

Copy all your TIDAL playlists from one account to another one.

copy_spotify_playlists_to_another_spotify_account()

Copy all your Spotify playlists from one account to another one. Displaying order is preserved.

copy_spotify_saved_tracks_to_another_spotify_account()

Copy all your Spotify saved tracks from one account to another one. Chronological order (when the track was added) is preserved.

There are also connect_to_spotify and connect_to_tidal functions, which you must run before running any of the other functions. Both authenticate you and return either a spotipy or tidalapi session.

To run

  1. Clone this repository
  2. Install the requirements: pip install -r requirements.txt
  3. Create a secrets.py file: touch secrets.py
  4. Copy and paste the following into the secrets file. You want numbers for both the tidal and spotify IDs, not your email address. See the sections below for how to obtain both your tidal and spotify IDs, as well as spotify client credentials. If you want to copy playlists and tracks from one TIDAL or Spotify account to another one, fill also the "_2" fields (e.g. copy FROM account with tidal_id TO account with tidal_id_2 or FROM account with spotify_id to account with spotify_id_2).
tidal_id = 'your_tidal_id'
tidal_username = '[email protected]'
tidal_pwd = 'your_tidal_password'
spotify_id = 'your_spotify_id'
spotify_username = '[email protected]'
SPOTIPY_CLIENT_ID = 'your_spotify_client_ID'
SPOTIPY_CLIENT_SECRET = 'your_spotify_client_secret'
SPOTIPY_REDIRECT_URI = 'http://localhost/'
spotify_discover_weekly_id = 'your_spotify_discover_weekly_id'
tidal_id_2 = 'your_tidal_id'
tidal_username_2 = '[email protected]'
tidal_pwd_2 = 'your_tidal_password'
spotify_id_2 = 'your_spotify_id'
spotify_username_2 = '[email protected]'
  1. Run script.py: python script.py. Right now, the script just signs into Spotify, signs into Tidal, and moves all Spotify songs to Tidal, but you can edit the script to run whatever functions you want.
  2. ???
  3. Profit.

To find your spotify ID

Go to your profile page on spotify, and click on the three dots > share > copy spotify URI. Then, when pasting the result into your secrets file, get rid of "spotify:user:" before the number.

To find your tidal ID

Go to the tidal web player, login and then open the Network pane inside the Developer tools in Firefox. Look at the request URL: your id will be right after v1/users/. Example: alt text

To find your spotify discover weekly ID

Go to your discover weekly playlist on spotify, and click on the three dots > share > copy playlist link. Then, when pasting the results into your secret file, copy the number between "https://open.spotify.com/user/spotify/playlist/" and "?si=bunchOfRandomThings".

Get spotify API client credentials

For some reason, there is no Spotify how-to on this that I can find, so here it is:

  1. Go here, sign in with your spotify account, and register an app.
  2. Click on the app, and copy the client ID and client secret into your secrets file.
  3. Click 'edit settings' in the top right corner.
  4. Scroll down to 'Redirect URIs' and add 'http://localhost/'
  5. Save Now you should be able to log in when running the program. A window will pop up asking you to sign in, and then the program will continue running.

Does it work?

Eh, good enough. A lot of songs aren't found because of the discrepancies between the two platforms with song names and artist names (Admiral vs. The Admiral). Further, a lot of songs have addendums - "We Belong - Odesza Remix", or "Storm Returns (A Prefuse/Tommy Guerrero Interlude)". A more dedicated programmer might parse the song names, perhaps getting rid of anything after a dash or anything between parenthesis. But this doesn't work all the time (I want the Odesza remix of We Belong, not the original!). The Tidal library is also a lot smaller than the Spotify library, unfortunately. If you would like to submit a PR to make this part of the code more robust, I would greatly welcome it.

About

Playlists migration between accounts of some music services (Spotify2Tidal, Tidal2Tidal, Spotify2Spotify)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%