This Music Playlist Generator is a C-based program that allows users to manage and enjoy music playlists with features like adding songs, playing tracks, shuffling playlists, and integrating YouTube search for song discovery. It uses a CSV file for local songs and supports dynamic user management and playback functionality.
- Sign Up: Create a new user account with a username and password.
- Login: Authenticate existing users to access their playlists.
- Add Songs:
- Add songs from a local CSV database.
- Add songs directly from YouTube search results.
- List Songs: View the songs currently in the playlist.
- Delete Songs: Remove specific songs from the playlist.
- Shuffle Playlist: Randomize the order of songs in the playlist.
- Play Next: Play the next song in the playlist and show detailed song information.
- Play Previous: Replay recently played songs using a stack-based structure.
- Show Current Song: Display details of the currently playing song.
- Recommend Songs: Suggest random songs from the global song database.
- YouTube Search Integration:
- Search for songs on YouTube via the
youtube_search.py
script. - Add selected YouTube songs to the playlist.
- Search for songs on YouTube via the
- C (Core application logic and playlist management)
- Python (YouTube search integration using the YouTube Data API)
- Standard C Libraries: For memory management, file handling, and linked list operations.
- YouTube Data API: Integrated for searching songs on YouTube.
- A C compiler (e.g., GCC).
- Python installed with the
google-api-python-client
library:pip install google-api-python-client
- Compile the C program:
gcc dsap.c -o music_playlist
- Run the compiled program:
./music_playlist
- Follow the menu options to manage playlists, play songs, and explore YouTube search.
To enable YouTube search:
- Ensure
youtube_search.py
is in the same directory. - Replace the placeholder
developerKey
inyoutube_search.py
with your YouTube Data API key.
- Adding Songs:
- Select from a preloaded song list (CSV file) or add songs from YouTube.
- Viewing Playlist:
- Lists all songs currently in the user’s playlist.
- Deleting Songs:
- Removes songs from the playlist by their position.
- Play Next:
- Plays the first song in the playlist and removes it from the list.
- Play Previous:
- Replays recently played songs stored in a stack.
- Show Current Song:
- Displays detailed information about the currently playing song.
- Search for songs on YouTube and print the top 10 results.
- Add selected YouTube results to the playlist.
-
Adding a Song:
- Option to select a song from the local database or search on YouTube.
- Example:
1: Shape of You - Ed Sheeran [Pop] 2: Blinding Lights - The Weeknd [Synthwave] Enter the song number to add to your playlist: 1
-
Playing Songs:
- Automatically shows the currently playing song with details.
-
YouTube Search:
- Example:
Enter search query: Ed Sheeran
- Output:
Title: Shape of You Video ID: JGwWNGJdvx8
- Example:
The corrected_songs.csv
file contains the following fields:
- Title: The song's title.
- Artist: The performing artist.
- Genre: The song's genre.