mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 13:35:12 +03:00
update
This commit is contained in:
parent
d71c931772
commit
46597a4c2b
File diff suppressed because one or more lines are too long
@ -4,6 +4,7 @@ import logging
|
||||
from logging.config import dictConfig
|
||||
import sys, os
|
||||
import base64
|
||||
import traceback
|
||||
|
||||
DATA_ROOT = "./"
|
||||
dictConfig({
|
||||
@ -34,17 +35,20 @@ def redirect_to_index():
|
||||
|
||||
CORS(app, resources={r"/*": {"origins": "*"}})
|
||||
|
||||
@app.route('/test', methods=['POST'])
|
||||
def test():
|
||||
@app.route('/api/voice', methods=['POST'])
|
||||
def api():
|
||||
try:
|
||||
print("POST REQUEST PROCESSING....\n")
|
||||
print(request)
|
||||
# filename = f"{prefix}{index:03}.zip"
|
||||
# data_dir = os.path.join(DATA_ROOT, title)
|
||||
# os.makedirs(data_dir,exist_ok=True)
|
||||
# fullpath = os.path.join(data_dir, filename)
|
||||
# data = base64.b64decode(request.json['data'])
|
||||
# f = open(fullpath, 'wb')
|
||||
# f.write(data)
|
||||
# f.close()
|
||||
filename = f"AAAAAAAAAAA.zip"
|
||||
data_dir = os.path.join(DATA_ROOT)
|
||||
os.makedirs(data_dir,exist_ok=True)
|
||||
fullpath = os.path.join(data_dir, filename)
|
||||
data = base64.b64decode(request.json['data'])
|
||||
f = open(fullpath, 'wb')
|
||||
f.write(data)
|
||||
f.close()
|
||||
data = {
|
||||
"message":"OK_TEST"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user