Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ def audio_separation():
|
|
19 |
# 下载MP3文件到本地
|
20 |
response = requests.get(mp3_url)
|
21 |
mp3_filename = mp3_url.split('/')[-1] # 使用下载的文件名
|
22 |
-
with open(
|
23 |
f.write(response.content)
|
24 |
|
25 |
# 执行音频分离操作
|
@@ -42,7 +42,7 @@ def audio_separation():
|
|
42 |
|
43 |
@app.route('/download/<filename>', methods=['GET'])
|
44 |
def download(filename):
|
45 |
-
return send_file(filename, as_attachment=True)
|
46 |
|
47 |
if __name__ == '__main__':
|
48 |
app.run(debug=False)
|
|
|
19 |
# 下载MP3文件到本地
|
20 |
response = requests.get(mp3_url)
|
21 |
mp3_filename = mp3_url.split('/')[-1] # 使用下载的文件名
|
22 |
+
with open(mp3_filename, 'wb') as f:
|
23 |
f.write(response.content)
|
24 |
|
25 |
# 执行音频分离操作
|
|
|
42 |
|
43 |
@app.route('/download/<filename>', methods=['GET'])
|
44 |
def download(filename):
|
45 |
+
return send_file("./separated/" + filename, as_attachment=True)
|
46 |
|
47 |
if __name__ == '__main__':
|
48 |
app.run(debug=False)
|