Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -29,6 +29,11 @@ def create_search_url_wikipedia(artist_song):
|
|
29 |
def create_search_url_youtube(artist_song):
|
30 |
base_url = "https://www.youtube.com/results?search_query="
|
31 |
return base_url + artist_song.replace(' ', '+').replace('β', '%E2%80%93').replace('&', 'and')
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
# Parsing the data
|
34 |
data = parse_data("data.txt")
|
@@ -44,13 +49,15 @@ for category, nominees in data.items():
|
|
44 |
st.header(f"{category} πΆ")
|
45 |
with st.expander("View Nominees"):
|
46 |
for nominee in nominees:
|
47 |
-
col1, col2, col3 = st.columns([4, 1, 1])
|
48 |
with col1:
|
49 |
st.markdown(f"* {nominee}")
|
50 |
with col2:
|
51 |
st.markdown(f"[Wikipedia]({create_search_url_wikipedia(nominee)})")
|
52 |
with col3:
|
53 |
st.markdown(f"[YouTube]({create_search_url_youtube(nominee)})")
|
|
|
|
|
54 |
|
55 |
# Footer
|
56 |
st.caption("Source: MTV Video Music Awards 2023")
|
|
|
29 |
def create_search_url_youtube(artist_song):
|
30 |
base_url = "https://www.youtube.com/results?search_query="
|
31 |
return base_url + artist_song.replace(' ', '+').replace('β', '%E2%80%93').replace('&', 'and')
|
32 |
+
|
33 |
+
# Function to create a search URL for Chords and Lyrics:
|
34 |
+
def create_search_url_chords(artist_song):
|
35 |
+
base_url = "https://www.ultimate-guitar.com/search.php?search_type=title&value="
|
36 |
+
return base_url + artist_song.replace(' ', '+').replace('β', '%E2%80%93').replace('&', 'and')
|
37 |
|
38 |
# Parsing the data
|
39 |
data = parse_data("data.txt")
|
|
|
49 |
st.header(f"{category} πΆ")
|
50 |
with st.expander("View Nominees"):
|
51 |
for nominee in nominees:
|
52 |
+
col1, col2, col3, col4 = st.columns([4, 1, 1, 1])
|
53 |
with col1:
|
54 |
st.markdown(f"* {nominee}")
|
55 |
with col2:
|
56 |
st.markdown(f"[Wikipedia]({create_search_url_wikipedia(nominee)})")
|
57 |
with col3:
|
58 |
st.markdown(f"[YouTube]({create_search_url_youtube(nominee)})")
|
59 |
+
with col3:
|
60 |
+
st.markdown(f"[Chords]({create_search_url_chords(nominee)})")
|
61 |
|
62 |
# Footer
|
63 |
st.caption("Source: MTV Video Music Awards 2023")
|