Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from flask import Flask, request, jsonify, render_template,
|
| 2 |
from bs4 import BeautifulSoup
|
| 3 |
from scraper import voicevox
|
| 4 |
import requests
|
|
@@ -18,7 +18,7 @@ def voicevox_resp():
|
|
| 18 |
|
| 19 |
try:
|
| 20 |
data = voicevox(text, speaker=speaker)
|
| 21 |
-
return
|
| 22 |
except Exception as e:
|
| 23 |
return jsonify({'error': str(e)}), 500
|
| 24 |
|
|
|
|
| 1 |
+
from flask import Flask, request, jsonify, render_template, send_bytes
|
| 2 |
from bs4 import BeautifulSoup
|
| 3 |
from scraper import voicevox
|
| 4 |
import requests
|
|
|
|
| 18 |
|
| 19 |
try:
|
| 20 |
data = voicevox(text, speaker=speaker)
|
| 21 |
+
return send_bytes(data), 200
|
| 22 |
except Exception as e:
|
| 23 |
return jsonify({'error': str(e)}), 500
|
| 24 |
|