Skip to content

hrishi-008/MelodyMigrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MelodyMigrate - iMusic to Spotify Playlist Converter

This project allows you to easily transfer playlists from Apple Music to Spotify. It uses Selenium to scrape song names from an Apple Music playlist and Spotipy (a Python client for the Spotify Web API) to search for these songs and create a playlist in Spotify.


Features

  • Automatically extracts song names from any public Apple Music playlist.
  • Creates a new playlist on Spotify with the extracted songs.
  • Skips songs that are unavailable on Spotify.
  • User authentication via Spotify API.

Installation

Prerequisites

Before running this project, ensure you have the following installed:

  • Python 3.x
  • Spotify Developer Account
  • Apple Music Playlist URL

Clone the repository

git clone https://github.com/hrishi-008/MelodyMigrate.git
cd MelodyMigrate

Install dependencies

pip install -r requirements.txt

Spotify API Setup

  1. Head over to Spotify Developer Dashboard and create a new app.
  2. Obtain the following credentials from your app:
    • Client ID
    • Client Secret
  3. Set up a .env file in the root of your project directory as follows:
SPOTIPY_CLIENT_ID=<Your Spotify Client ID>
SPOTIPY_CLIENT_SECRET=<Your Spotify Client Secret>

Usage

  1. Run the script to extract songs from an Apple Music playlist and create a new Spotify playlist:
python pipe.py
  1. Enter the Apple Music Playlist URL when prompted. The script will then:
    • Scrape the song names using Selenium.
    • Search Spotify for these songs using the Spotify API.
    • Create a new private Spotify playlist and add the found songs to it.

How It Works

  1. Selenium Scraper:

    • A Selenium script fetches the playlist webpage from Apple Music and extracts song names.
  2. Spotipy API:

    • The Spotipy library is used to interact with Spotify's API to search for each song and add it to the user's playlist.

Dependencies

  • Selenium: To scrape song data from Apple Music.
  • Spotipy: Python library to interact with the Spotify Web API.
  • BeautifulSoup: (Optional) For additional web scraping functionalities.
  • Requests: To handle HTTP requests.

You can install all dependencies using:

pip install selenium spotipy beautifulsoup4 requests

Resources


Contributing

Feel free to submit issues or pull requests for improvements and new features!


Acknowledgments

  • Thanks to Spotipy for simplifying the interaction with Spotify's API.
  • Thanks to the Spotify Developer team for providing an excellent API!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages