This project is a simple Node.js application that allows you to create a new Spotify playlist by shuffling tracks from multiple existing playlists. It uses the Spotify Web API for playlist manipulation and track retrieval.
Before running the application, you need to obtain Spotify API credentials (Client ID and Client Secret) by creating a Spotify Developer account at Spotify for Developers.
Replace the placeholder values for clientId
and clientSecret
in the authorizeSpotify
function with your actual Spotify API credentials.
const clientId = "YOUR_CLIENT_ID";
const clientSecret = "YOUR_CLIENT_SECRET";
In the playlistIds array at the beginning of your application file, replace the existing playlist IDs with the IDs of the playlists you want to shuffle together.
const playlistIds = [ "your_playlist_id_1", "your_playlist_id_2", "your_playlist_id_3", ];
Adjust the values in the createShuffledPlaylist function to set the number of songs and the name of the new playlist. For example:
createShuffledPlaylist(20, "Shuffled Playlist 1");
Run the following command to install the necessary Node.js packages:
npm install
Start the application by running:
node SpotifyPlaylistRandomizer.js
The application will provide a URL to log in to Spotify. Open the URL in a web browser, log in to your Spotify account, and authorize the application.