This project is a web application that allows users to convert Spotify playlists into downloadable MP3 files. By pasting a Spotify playlist link, users can easily download all the songs from that playlist as MP3 files compressed into a ZIP file.
- Fetches Spotify playlist details, including song titles and artists.
- Searches for corresponding YouTube links for each track.
- Downloads the audio from the YouTube videos as MP3 files.
- Compresses all downloaded MP3 files into a single ZIP file named after the Spotify playlist.
- Simple and intuitive interface for seamless user experience.
- Node.js: Server-side JavaScript runtime.
- Express: Web framework for Node.js.
- Axios: Promise-based HTTP client for making requests.
- Archiver: For creating ZIP files.
- yt-dlp: Tool for downloading videos from YouTube and converting them to audio.
- Spotify API: To access playlist data.
- YouTube Data API: To search for videos based on song titles and artists.
- Node.js and npm: Make sure you have Node.js installed. You can download it from nodejs.org.
-
Clone the repository:
git clone https://github.com/cdobby9/spotify-to-mp3.git cd spotify-to-mp3 -
Install dependencies:
npm install
-
Set up environment variables: Create a
.envfile in the root directory and add your Spotify and YouTube API keys:SPOTIFY_CLIENT_ID=your_spotify_client_id SPOTIFY_CLIENT_SECRET=your_spotify_client_secret YOUTUBE_API_KEY=your_youtube_api_key -
Install
yt-dlp: Make sure you haveyt-dlpinstalled. You can download it from yt-dlp's GitHub page. -
Run the application:
node index.js
-
Access the application: Open your browser and go to http://localhost:3000/download-playlist.
- To download a Spotify playlist, append the playlist URL to the endpoint:
- If you encounter issues with downloading, ensure that the Spotify and YouTube API keys are valid and properly configured.
- Check that
yt-dlpis correctly installed and available in your system's PATH.
Contributions are welcome! If you have suggestions or improvements, feel free to open an issue or submit a pull request.