Spotifyly AI is a Go application that fetches your liked songs from Spotify and groups them based on specific criteria using AI. This application uses the OpenAI GPT API to analyze songs and create customized playlists.
- Fetches liked songs from Spotify.
- Groups songs based on specific criteria (e.g., genre, artist, mood, year, etc.).
- Uses AI to analyze songs and generate customized playlists.
git clone https://github.com/yunustiras/spotifyly-ai.git
cd spotifyly-ai
go mod download
go build -o spotifyly-ai cmd/spotifyly-ai/main.go
./spotifyly-ai
When you run the application, it fetches your liked songs from Spotify and groups them based on the specified criteria. You can pass the grouping criteria as a parameter to the GroupSongsByCriteria
function.
groupedSongs, err := h.GroupSongsByCriteria("genre")
map[string][]Song{
"Pop": {
{Name: "Shape of You", Artist: "Ed Sheeran"},
{Name: "Blinding Lights", Artist: "The Weeknd"},
},
"Rock": {
{Name: "Bohemian Rhapsody", Artist: "Queen"},
},
}
groupedSongs, err := h.GroupSongsByCriteria("artist")
map[string][]Song{
"Ed Sheeran": {
{Name: "Shape of You", Artist: "Ed Sheeran"},
},
"Queen": {
{Name: "Bohemian Rhapsody", Artist: "Queen"},
},
}
groupedSongs, err := h.GroupSongsByCriteria("mood")
map[string][]Song{
"Energetic": {
{Name: "Uptown Funk", Artist: "Mark Ronson ft. Bruno Mars"},
},
"Sad": {
{Name: "Someone Like You", Artist: "Adele"},
},
}
groupedSongs, err := h.GroupSongsByCriteria("year")
map[string][]Song{
"2010s": {
{Name: "Rolling in the Deep", Artist: "Adele"},
},
"2020s": {
{Name: "Levitating", Artist: "Dua Lipa"},
},
}
The application fetches your liked songs from Spotify using the Spotify API.
The fetched songs are sent to the OpenAI GPT API, which analyzes and groups them based on the specified criteria.
The grouped songs are displayed in the terminal.