mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 22:07:10 +00:00
Merge branch 'v2' into v2
This commit is contained in:
commit
f1ca8e2d6c
12 changed files with 404 additions and 263 deletions
|
|
@ -66,6 +66,10 @@ async function uploadRecord (recordUrl, ttsMode = 'vits-uma-genshin-honkai') {
|
|||
recordUrl = tmpFile
|
||||
}
|
||||
if (recordType === 'file' || Config.cloudMode === 'file') {
|
||||
if (!recordUrl) {
|
||||
logger.error('云转码错误:recordUrl 异常')
|
||||
return false
|
||||
}
|
||||
const formData = new FormData()
|
||||
let buffer
|
||||
if (!recordUrl.startsWith('http')) {
|
||||
|
|
@ -87,9 +91,13 @@ async function uploadRecord (recordUrl, ttsMode = 'vits-uma-genshin-honkai') {
|
|||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
let t = await resultres.text()
|
||||
let t = await resultres.arrayBuffer()
|
||||
try {
|
||||
result = JSON.parse(t)
|
||||
result = {
|
||||
buffer: {
|
||||
data: t
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
logger.error(t)
|
||||
throw e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue