🏆 Best Project — UCSD CSES Tridev Hackathon 2022
Auto-Playlist is an intelligent Discord bot that automatically queues songs based on the currently playing Spotify track. It uses a modified K-Means clustering algorithm and the Spotify API to generate smart playlists on the fly.
- 🔁 Queue songs similar to the one currently playing on your Spotify
- 🤖 Easily controlled through a
!queue [num_songs]command on Discord - 🧠 Uses a custom K-Means-based clustering algorithm for intelligent song recommendations
- 🎵 Integrates with the Spotify API to fetch song data and features
git clone https://github.com/your-username/Auto-Playlist.git
cd Auto-Playlist
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt- Go to the Discord Developer Portal
- Click "New Application", and give it a name
- Navigate to the Bot tab on the left sidebar
- Click "Add Bot"
- Reveal and copy your Bot Token
- Paste this token into your
discord.pyfile in the appropriate location
- Go to OAuth2 → URL Generator
- Under Scopes, check:
bot - Under Bot Permissions, select:
View ChannelsSend MessagesRead Message HistoryConnectSpeak
- Copy the generated URL, paste it into your browser, and invite the bot to your Discord server
- Visit the Spotify Developer Dashboard
- Log in or sign up for an account
- Go to Dashboard → Create an App
- Give it a name (anything works)
- Under Redirect URIs, add:
https://google.com - Note your Client ID and Client Secret
- Paste these credentials into
spotify_methods.pywhere required
Make sure:
- ✅ A song is currently playing on your Spotify
- ✅ The bot has been added to your Discord server
Then run:
python discord.pyIn your Discord server, type:
!queue [number_of_songs]
The bot will respond with a Spotify authorization URL.
- Click the link and log in to Spotify
- After authorization, you will be redirected to a URI (likely starting with
https://google.com) - Copy the entire redirected URL
- Paste it into your terminal when prompted
🎉 Your playlist will now be intelligently queued with similar songs!
- Python
- Discord.py (Bot)
- Spotify Web API
- K-Means Clustering (custom implementation)