Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -131,6 +131,8 @@ def process_audio_separation(task_id, mp3_url):
|
|
131 |
try:
|
132 |
# 下载MP3文件到本地
|
133 |
response = requests.get(mp3_url)
|
|
|
|
|
134 |
mp3_filename = mp3_url.split('/')[-1]
|
135 |
with open("/tmp/" + mp3_filename, 'wb') as f:
|
136 |
f.write(response.content)
|
@@ -163,7 +165,7 @@ def process_audio_separation(task_id, mp3_url):
|
|
163 |
tasks[task_id] = {
|
164 |
"status": "error",
|
165 |
"message": str(e),
|
166 |
-
"debug_traceback": str(traceback.format_exception(
|
167 |
}
|
168 |
|
169 |
app = Flask(__name__)
|
|
|
131 |
try:
|
132 |
# 下载MP3文件到本地
|
133 |
response = requests.get(mp3_url)
|
134 |
+
if response.code != 200:
|
135 |
+
raise Exception("无效的 URL")
|
136 |
mp3_filename = mp3_url.split('/')[-1]
|
137 |
with open("/tmp/" + mp3_filename, 'wb') as f:
|
138 |
f.write(response.content)
|
|
|
165 |
tasks[task_id] = {
|
166 |
"status": "error",
|
167 |
"message": str(e),
|
168 |
+
"debug_traceback": str(traceback.format_exception())
|
169 |
}
|
170 |
|
171 |
app = Flask(__name__)
|