Have old iTunes playlists of songs you downloaded (and maybe named poorly)? Well, you probably don't but I did and my dad did so I made something.
This package converts iTunes playlists into Spotify playlists by searching Spotify for the songs in your iTunes playlist and adding them to a Spotify playlist. Works for most songs even if the name and artist are not written exactly how they appear in Spotify.
This project is in a live web app HERE. Code for the web app is in a separate repository.
Thanks to spotipy for making a python wrapper of the spotify API :)
- Head over to itunes-to-spotify.herokuapp.com, log in, and get going!
-
Get spotify API credentials
- Go to spotify developer and create credentials
- Change the name of
itunes_to_spotify/example_creds.py
toitunes_to_spotify/creds.py
and fill it in with the appropriate user info
-
Export iTunes playlist as text file:
- Highlight playlist in iTunes
- File > Library > Export Playlist
- Export as Unicode text (this creates a tab-delimited .txt file of iTunes playlist)
-
Create Spotify playlist and get a URI
- Create a Spotify playlist
- Click the three dots icon
- hover over "Share"
- click copy spotify URI
-
Installation (either of the two options below)
# installation for command line version
$ pip install git+https://github.com/samryan18/itunes-to-spotify.git
# installation for local development
# -e is editable flag
$ git clone https://github.com/samryan18/itunes-to-spotify.git
$ pip install -e itunes-to-spotify
- Run to Create New Playlist
$ itunes_to_spotify_new [OPTIONS]
# Example (run with arguments in one go):
$ itunes_to_spotify_new --verbose --playlist_name="awesome playlist" --playlist_desc="description" --filepath="path_to_textfile"
A link will open asking you to login and allow the app to access your playlists.
- Include
--playlist_name="playlist_name"
to specify name of new playlist - Prompted for if not included
- Include
--playlist_desc="playlist_desc"
to specify description of new playlist - Prompted for if not included
- Include
--filepath="path_to_textfile"
to specify filepath - Prompted for if not included
- Flag for whether to print info about the run
- Include
--verbose
to run in this mode
- Run
$ itunes_to_spotify_new --help
for help.
$ itunes_to_spotify [OPTIONS]
# Example (run with arguments in one go):
$ itunes_to_spotify --verbose --playlist_uri="playlist_uri" --filepath="path_to_textfile"
A link will open asking you to login and allow the app to access your playlists.
- Include
--playlist_uri="playlist_uri"
to specify playlist URI - Prompted for if not included
- Include
--filepath="path_to_textfile"
to specify filepath - Prompted for if not included
- Flag for whether to print info about the run
- Include
--verbose
to run in this mode
- Run
$ itunes_to_spotify --help
for help.