Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -102,6 +102,7 @@ def recognize_audio(choice, url, file):
|
|
102 |
# Parse the response into a structured format
|
103 |
try:
|
104 |
data = response.json()
|
|
|
105 |
|
106 |
# Check if the response contains an error
|
107 |
if result.get("status") == "error":
|
@@ -111,7 +112,6 @@ def recognize_audio(choice, url, file):
|
|
111 |
{error_message}
|
112 |
"""
|
113 |
|
114 |
-
result = data.get('result', {})
|
115 |
artist = result.get('artist', 'Unknown Artist')
|
116 |
title = result.get('title', 'Unknown Title')
|
117 |
album = result.get('album', 'Unknown Album')
|
|
|
102 |
# Parse the response into a structured format
|
103 |
try:
|
104 |
data = response.json()
|
105 |
+
result = data.get('result', {})
|
106 |
|
107 |
# Check if the response contains an error
|
108 |
if result.get("status") == "error":
|
|
|
112 |
{error_message}
|
113 |
"""
|
114 |
|
|
|
115 |
artist = result.get('artist', 'Unknown Artist')
|
116 |
title = result.get('title', 'Unknown Title')
|
117 |
album = result.get('album', 'Unknown Album')
|