Spaces:
Sleeping
Sleeping
added try-except logic to deal with bad song urls
Browse files
app.py
CHANGED
@@ -86,9 +86,15 @@ if st.button("Generate Some Music!"):
|
|
86 |
col5.header(f"Genre: {result.payload['genre']}")
|
87 |
col5.markdown(f"### Artist: {result.payload['artist']}")
|
88 |
col5.markdown(f"#### Song name: {result.payload['name']}")
|
89 |
-
|
|
|
|
|
|
|
90 |
else:
|
91 |
col6.header(f"Genre: {result.payload['genre']}")
|
92 |
col6.markdown(f"### Artist: {result.payload['artist']}")
|
93 |
col6.markdown(f"#### Song name: {result.payload['name']}")
|
94 |
-
|
|
|
|
|
|
|
|
86 |
col5.header(f"Genre: {result.payload['genre']}")
|
87 |
col5.markdown(f"### Artist: {result.payload['artist']}")
|
88 |
col5.markdown(f"#### Song name: {result.payload['name']}")
|
89 |
+
try:
|
90 |
+
col5.audio(result.payload["urls"])
|
91 |
+
except:
|
92 |
+
continue
|
93 |
else:
|
94 |
col6.header(f"Genre: {result.payload['genre']}")
|
95 |
col6.markdown(f"### Artist: {result.payload['artist']}")
|
96 |
col6.markdown(f"#### Song name: {result.payload['name']}")
|
97 |
+
try:
|
98 |
+
col6.audio(result.payload["urls"])
|
99 |
+
except:
|
100 |
+
continue
|