-
Notifications
You must be signed in to change notification settings - Fork 214
/
Copy pathmood-based-playlist-generator.py
100 lines (94 loc) · 4.29 KB
/
mood-based-playlist-generator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import random
# Expanded playlists with moods and languages
playlists = {
"happy": {
"english": [
"Happy - Pharrell Williams", "Uptown Funk - Bruno Mars", "Can't Stop the Feeling - Justin Timberlake",
"Shake It Off - Taylor Swift", "Best Day of My Life - American Authors"
],
"hindi": [
"Gallan Goodiyan - Dil Dhadakne Do", "Subah Hone Na De - Desi Boyz", "London Thumakda - Queen",
"Balam Pichkari - Yeh Jawaani Hai Deewani", "Cutiepie - Ae Dil Hai Mushkil"
],
"kpop": [
"Dynamite - BTS", "Lovesick Girls - BLACKPINK", "Psycho - Red Velvet",
"LALISA - Lisa", "Ice Cream - BLACKPINK ft. Selena Gomez"
],
"tamil": [
"Vaathi Coming - Master", "Megham Karukatha - Thiruchitrambalam",
"Why This Kolaveri Di - 3", "Jolly O Gymkhana - Beast", "Aaluma Doluma - Vedalam"
]
},
"sad": {
"english": [
"Someone Like You - Adele", "Fix You - Coldplay", "Let Her Go - Passenger",
"Stay With Me - Sam Smith", "All I Want - Kodaline"
],
"hindi": [
"Tujhe Bhula Diya - Anjaana Anjaani", "Tum Hi Ho - Aashiqui 2", "Channa Mereya - Ae Dil Hai Mushkil",
"Agar Tum Saath Ho - Tamasha", "Phir Le Aya Dil - Barfi"
],
"kpop": [
"Spring Day - BTS", "Stay - BLACKPINK", "Hold On - NCT 127",
"Love Poem - IU", "Blue & Grey - BTS"
],
"tamil": [
"Ennodu Nee Irundhal - I", "Oru Deivam Thantha Poove - Kannathil Muthamittal",
"Nenjukkul Peidhidum - Vaaranam Aayiram", "Uyire - Bombay", "Kanmani Anbodu - Guna"
]
},
"relaxed": {
"english": [
"Weightless - Marconi Union", "Clair de Lune - Debussy", "Chill Vibes - Various Artists",
"Easy On Me - Adele", "The Night We Met - Lord Huron"
],
"hindi": [
"Tum Mile - Tum Mile", "Phir Se Ud Chala - Rockstar", "Dil Dhadakne Do - ZNMD",
"Ilahi - Yeh Jawaani Hai Deewani", "Pee Loon - Once Upon a Time in Mumbaai"
],
"kpop": [
"Palette - IU ft. G-Dragon", "Eight - IU ft. Suga", "Our Summer - TXT",
"Love Scenario - iKON", "Serendipity - BTS"
],
"tamil": [
"Munbe Vaa - Sillunu Oru Kadhal", "New York Nagaram - Sillunu Oru Kadhal",
"Nenjukulle - Kadal", "Maruvaarthai - Enai Noki Paayum Thota", "Kangal Irandal - Subramaniapuram"
]
},
"energetic": {
"english": [
"Eye of the Tiger - Survivor", "Stronger - Kanye West", "Don't Stop Me Now - Queen",
"We Will Rock You - Queen", "Thunder - Imagine Dragons"
],
"hindi": [
"Kala Chashma - Baar Baar Dekho", "Kar Gayi Chull - Kapoor & Sons",
"Zingaat - Dhadak", "Saturday Saturday - Humpty Sharma Ki Dulhania", "Bang Bang - Bang Bang"
],
"kpop": [
"Mic Drop - BTS", "Fire - BTS", "Kill This Love - BLACKPINK",
"I'm the Best - 2NE1", "Warrior - B.A.P"
],
"tamil": [
"Rakita Rakita - Jagame Thandhiram", "Kutti Story - Master", "Vaadi Vaadi - Sachein",
"Dandanakka - Romeo Juliet", "Anirudh Mashup - Anirudh Ravichander"
]
}
}
# Welcome message
print("🎵 Welcome to the Mood-Based Playlist Generator! 🎵\n")
# Ask the user for their mood
print("Moods available: Happy, Sad, Relaxed, Energetic")
mood = input("How are you feeling today? (e.g., happy, sad, relaxed, energetic): ").strip().lower()
# Ask the user for their language preference
print("\nLanguages available: English, Hindi, K-pop, Tamil")
language = input("Which language do you prefer? (e.g., english, hindi, kpop, tamil): ").strip().lower()
# Generate and display the playlist
if mood in playlists and language in playlists[mood]:
print(f"\nHere's a {language.capitalize()} playlist to match your mood ({mood.capitalize()}):\n")
songs = playlists[mood][language]
# Display 5 random songs from the playlist
for song in random.sample(songs, min(5, len(songs))):
print(f"- {song}")
else:
print("\nSorry, I don't have a playlist for that combination yet. Try another mood or language!")
print("\nThank you for using the Mood-Based Playlist Generator! 🎧")