Local Music to Spotify Playlist Creator is a Python application that allows users to convert their offline music collections into Spotify playlists. By scanning local MP3 files for metadata (title and artist), this tool searches for the corresponding songs on Spotify and adds them to a user-defined playlist.
- Extracts song title and artist information from local MP3 files.
- Searches for songs on Spotify using the Spotify API.
- Creates a new playlist or updates an existing playlist on Spotify.
- User-friendly output indicating the status of each song added.
To run this application, you'll need:
- Python 3.x installed on your system.
- A Spotify account (free or premium).
- An application registered on the Spotify Developer Dashboard to obtain your API credentials.
-
Clone the repository:
git clone https://github.com/yourusername/local-music-to-spotify-playlist-creator.git cd local-music-to-spotify-playlist-creator
-
Set up a virtual environment (optional but recommended):
python -m venv venv venv\Scripts\activate
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.env
file in the project directory and add your Spotify API credentials:SPOTIPY_CLIENT_ID='your_spotify_client_id' SPOTIPY_CLIENT_SECRET='your_spotify_client_secret' SPOTIPY_REDIRECT_URI='http://localhost:8888/callback'
-
Place your local MP3 files in a folder (e.g.,
I:\New folder\Music\ENGLISH\New folder (2)
). -
Modify the
offline_folder
andplaylist_name
variables in the script to point to your local folder and desired playlist name, respectively. -
Run the script:
python local_music_to_spotify.py
-
Follow the authentication process in your browser to allow the app to access your Spotify account.
- The application currently supports MP3 files. You can modify the code to support other formats if desired.
- Ensure that you have an active internet connection to search for songs on Spotify.
This project is licensed under the MIT License. See the LICENSE file for details.