Skip to content

kevinantonygomez/Apple-Music-to-Spotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

This is a Python program that grabs songs from an Apple Music Playlist and adds them to a Spotify playlist through Spotify's web API.

How it works: The program's execution can be divided in 4 distinct steps:

  1. Grab songs and their corresponding artist names from the Apple Music playlist on web.
  2. Use Spotify's GET/search API to recieve a catalogue of search results.
  3. Find the song within the search results and retrieve it's unique ID.
  4. Send a POST 'Add items to Playlist' request to Spotify.

To get started:

  1. Enter your Apple Music playlist URL in main.py.
  2. Enter your Spotify playlist ID in main.py.
  3. Head over to the Spotify API docs (https://developer.spotify.com/console/post-playlist-tracks/) and create your OAuth Token.
  4. Set the Spotify API params and your generated Token in main.py.
  5. Run!

Note:
Not all songs are successfully found/added to Spotify. One reason could be that Spotify simply doesn't have the song in its library. Another, more common one, is that the songs' names do not match 1-to-1 across platforms. For example: Apple may have a song as "Song X (feat Artist Y)", while Spotify may have it simply as "Song X". To account for this, the songs' and artists' names are edited down prior to search to find the closest match between strings. This can still sometimes result in songs not being found in Spotify.
In these instances, debug statements are added to print out the songs that weren't added. From my tests with playlists containing 200+ songs in multiple languages, only about ~5-10 songs failed to be added.

About

Transfer Apple Music playlists to Spotify

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages