Skip to content

Kuwertzel/AppleMusic2Spotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AppleMusic2Spotify

This script can read public Apple Music playlists and create mirrored playlists on Spotify.

Personal playlists can be used too, as long as they are made publicly visible.

Setup

  1. Install a recent version of Python.
  2. Install the python modules requests, mechanicalsoup and tekore, e.g. using pip install -r requirements.txt
  3. Follow this guide to register a new Spotify application using your Spotify account. Take note of the client ID, client secret and redirect URI.
  4. Download both applemusic2spotify.py and config.py or clone this repo.
  5. Put the Apple Music playlist URLs into the list in config.py.
  6. Run applemusic2spotify.py put your Spotify app credentials into the cli.
  7. A new tab in your default browser should open, displaying a Spotify authentication dialog. Click accept and copy the long URL you got redirected to.
  8. Paste the URL into the cli and hit return.
  9. The script should now create a file called tekore.cfg in the working directory. This file will from now on be used for automatic authentication.
  10. The script should now the HTML of the Apple Music playlists,

If you want to keep changes in the config.py when updating using git pull, rename the file to config_dev.py. This file is added to .gitignore so that changes to it will not be overridden/synced. If config_dev.py is present, config.py will be ignored by the script.

Note

I tested the script on Windows 11, however I don't think I used any platform-specific code. So Linux and Mac likely work fine, too!

The code is very basic and partially unfinished. I have not put much time into optimization (e.g. async execution).

Use at your own risk and feel free to adjust to your own preference.

This is my first proper project to be published on GitHub and I take it as an opportunity to learn about Git and GitHub :D I'm happy about any and all recommendations on how I can improve this repo!

TO-DOs

  • create get_clean_title function
  • add "... (with ARTIST)" to get_clean_title function
  • load more than the first ~300 tracks from Apple Music. This will most likely require the use of selenium to scroll down for additional tracks to load.
  • extend extract_artists function to also parse square brackets eg. [feat. Sean Paul & Anne-Marie]

About

Mirror public playlists from Apple Music to Spotify.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages