Update plugins/sora2.js
Browse files- plugins/sora2.js +11 -5
plugins/sora2.js
CHANGED
|
@@ -19,11 +19,18 @@ function generatePassword() {
|
|
| 19 |
|
| 20 |
async function proxyRequest(url, options = {}) {
|
| 21 |
const targetUrl = url.startsWith('http') ? url : `https://api.bylo.ai${url}`
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
return axios({
|
| 25 |
-
url:
|
| 26 |
-
...options
|
|
|
|
| 27 |
})
|
| 28 |
}
|
| 29 |
|
|
@@ -278,7 +285,7 @@ const handler = async (req, res) => {
|
|
| 278 |
password: result.password
|
| 279 |
}
|
| 280 |
}
|
| 281 |
-
|
| 282 |
} catch (error) {
|
| 283 |
console.error('Error generating Sora2 video:', error)
|
| 284 |
res.status(500).json({
|
|
@@ -298,6 +305,5 @@ module.exports = {
|
|
| 298 |
parameters: ['prompt', 'ratio', 'key'],
|
| 299 |
enabled: true,
|
| 300 |
main: ['AI'],
|
| 301 |
-
limit: 10,
|
| 302 |
handler
|
| 303 |
}
|
|
|
|
| 19 |
|
| 20 |
async function proxyRequest(url, options = {}) {
|
| 21 |
const targetUrl = url.startsWith('http') ? url : `https://api.bylo.ai${url}`
|
| 22 |
+
|
| 23 |
+
const headers = {
|
| 24 |
+
'Origin': 'https://bylo.ai',
|
| 25 |
+
'Referer': 'https://bylo.ai/',
|
| 26 |
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
| 27 |
+
...(options.headers || {})
|
| 28 |
+
}
|
| 29 |
|
| 30 |
return axios({
|
| 31 |
+
url: targetUrl,
|
| 32 |
+
...options,
|
| 33 |
+
headers
|
| 34 |
})
|
| 35 |
}
|
| 36 |
|
|
|
|
| 285 |
password: result.password
|
| 286 |
}
|
| 287 |
}
|
| 288 |
+
})
|
| 289 |
} catch (error) {
|
| 290 |
console.error('Error generating Sora2 video:', error)
|
| 291 |
res.status(500).json({
|
|
|
|
| 305 |
parameters: ['prompt', 'ratio', 'key'],
|
| 306 |
enabled: true,
|
| 307 |
main: ['AI'],
|
|
|
|
| 308 |
handler
|
| 309 |
}
|