This Python script fetches a random song from YouTube based on your mood input and opens it in your default web browser.
Accepts mood input (e.g., happy, sad, energetic) and finds related songs on YouTube. Opens the YouTube song URL in your browser.
pip install -r requirements.txt
- Follow the instructions to get your YouTube Data API key.
Replace the api_key variable in the script with your own YouTube Data API key
api_key = "YOUR_YOUTUBE_API_KEY"
python random_song_generator.py
Input:
Enter your mood (e.g., happy, sad, energetic): happy
The script will fetch a song and open it in your browser.