Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -55,13 +55,7 @@ def analyze_song(mp3_file):
|
|
55 |
}
|
56 |
result = requests.post('https://api.audd.io/', data=data, files=files)
|
57 |
transcription = transcribe_audio('test.wav')
|
58 |
-
|
59 |
-
image_url = ""
|
60 |
-
genre = ""
|
61 |
-
genius_response = get_song_info_from_lyrics(transcription)
|
62 |
-
title = genius_response["title"]
|
63 |
-
artist = genius_response["artist"]
|
64 |
-
else:
|
65 |
artist = result.json()['result']['artist']
|
66 |
title = result.json()['result']['title']
|
67 |
# genre = result.json()['result']['apple_music']['genreNames']
|
@@ -74,6 +68,12 @@ def analyze_song(mp3_file):
|
|
74 |
image_url = result.json()['result']['spotify']['album']['images'][0]['url']
|
75 |
except:
|
76 |
image_url = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
# else:
|
78 |
song_data = json.loads(info(title, artist))
|
79 |
if (genre == None):
|
|
|
55 |
}
|
56 |
result = requests.post('https://api.audd.io/', data=data, files=files)
|
57 |
transcription = transcribe_audio('test.wav')
|
58 |
+
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
artist = result.json()['result']['artist']
|
60 |
title = result.json()['result']['title']
|
61 |
# genre = result.json()['result']['apple_music']['genreNames']
|
|
|
68 |
image_url = result.json()['result']['spotify']['album']['images'][0]['url']
|
69 |
except:
|
70 |
image_url = ""
|
71 |
+
except:
|
72 |
+
image_url = ""
|
73 |
+
genre = ""
|
74 |
+
genius_response = get_song_info_from_lyrics(transcription)
|
75 |
+
title = genius_response["title"]
|
76 |
+
artist = genius_response["artist"]
|
77 |
# else:
|
78 |
song_data = json.loads(info(title, artist))
|
79 |
if (genre == None):
|