Skip to content

Latest commit

 

History

History
109 lines (78 loc) · 3.63 KB

README.md

File metadata and controls

109 lines (78 loc) · 3.63 KB

iTunes to Spotify

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 :)


Instructions

  1. Head over to itunes-to-spotify.herokuapp.com, log in, and get going!

Instructions (local dev / command line version)

  1. Get spotify API credentials

    • Go to spotify developer and create credentials
    • Change the name of itunes_to_spotify/example_creds.py to itunes_to_spotify/creds.py and fill it in with the appropriate user info
  2. 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)
  3. Create Spotify playlist and get a URI

    • Create a Spotify playlist
    • Click the three dots icon
      • hover over "Share"
      • click copy spotify URI
  4. 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
  1. 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.


Options

Playlist Name [--playlist_name]
  • Include --playlist_name="playlist_name" to specify name of new playlist
  • Prompted for if not included
Playlist Description [--playlist_desc]
  • Include --playlist_desc="playlist_desc" to specify description of new playlist
  • Prompted for if not included
Path to iTunes playlist file [--filepath]
  • Include --filepath="path_to_textfile" to specify filepath
  • Prompted for if not included
Verbose [--verbose]
  • Flag for whether to print info about the run
  • Include --verbose to run in this mode
Help [--help]
  • Run $ itunes_to_spotify_new --help for help.

Optional: Run to Overwrite Existing Playlist

$ 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.


Options

Playlist URI [--playlist_uri]
  • Include --playlist_uri="playlist_uri" to specify playlist URI
  • Prompted for if not included
Path to iTunes playlist file [--filepath]
  • Include --filepath="path_to_textfile" to specify filepath
  • Prompted for if not included
Verbose [--verbose]
  • Flag for whether to print info about the run
  • Include --verbose to run in this mode
Help [--help]
  • Run $ itunes_to_spotify --help for help.