ramonpzg commited on
Commit
50b6be3
1 Parent(s): 416ff82

added try-except logic to deal with bad song urls

Browse files
Files changed (1) hide show
  1. app.py +8 -2
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
- col5.audio(result.payload["urls"])
 
 
 
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
- col6.audio(result.payload["urls"])
 
 
 
 
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