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.
Delete all your tidal playlists.
Move all your tidal playlists to spotify.
Move one of your tidal playlists to spotify. Takes a playlist ID
Move all of your spotify playlists to tidal.
Move all your favourites/liked/saved tracks from spotify to your favourites tracks in 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 all your TIDAL playlists from one account to another one.
Copy all your Spotify playlists from one account to another one. Displaying order is preserved.
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.
pip install -r requirements.txt
touch secrets.py
tidal_id = 'your_tidal_id'
tidal_username = 'your_tidal_email_address@email.com'
tidal_pwd = 'your_tidal_password'
spotify_id = 'your_spotify_id'
spotify_username = 'your_spotify_email_address@email.com'
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 = 'your_tidal_email_address@email.com'
tidal_pwd_2 = 'your_tidal_password'
spotify_id_2 = 'your_spotify_id'
spotify_username_2 = 'your_spotify_email_address@email.com'
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.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.
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:
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".
For some reason, there is no Spotify how-to on this that I can find, so here it is:
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.