Update plugins/sunov2.js
Browse files- plugins/sunov2.js +17 -8
plugins/sunov2.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
const axios = require('axios');
|
| 2 |
-
const { shannz: cf } = require('bycf');
|
| 3 |
|
| 4 |
class YesChatMusicGenerator {
|
| 5 |
constructor() {
|
|
@@ -8,11 +7,22 @@ class YesChatMusicGenerator {
|
|
| 8 |
|
| 9 |
async getBypassToken() {
|
| 10 |
try {
|
| 11 |
-
const
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
} catch (error) {
|
| 17 |
throw new Error(`Failed to get bypass token: ${error.message}`);
|
| 18 |
}
|
|
@@ -186,10 +196,9 @@ const handler = async (req, res) => {
|
|
| 186 |
|
| 187 |
module.exports = {
|
| 188 |
name: 'SunoV2 Music Generator',
|
| 189 |
-
description: 'Generate music using YesChat AI with custom lyrics or AI-generated lyrics',
|
| 190 |
type: 'GET',
|
| 191 |
routes: ['api/AI/sunov2'],
|
| 192 |
-
tags: ['ai', 'music', '
|
| 193 |
main: ['AI'],
|
| 194 |
limit: 12,
|
| 195 |
parameters: ['mode', 'prompt', 'lyrics', 'title', 'style', 'instrumental', 'key'],
|
|
|
|
| 1 |
const axios = require('axios');
|
|
|
|
| 2 |
|
| 3 |
class YesChatMusicGenerator {
|
| 4 |
constructor() {
|
|
|
|
| 7 |
|
| 8 |
async getBypassToken() {
|
| 9 |
try {
|
| 10 |
+
const response = await axios.get('https://anabot.my.id/api/tools/bypass', {
|
| 11 |
+
params: {
|
| 12 |
+
url: 'https://www.yeschat.ai/',
|
| 13 |
+
siteKey: '0x4AAAAAAATOXAtQtziH-Rwq',
|
| 14 |
+
type: 'turnstile-min',
|
| 15 |
+
apikey: 'freeApikey'
|
| 16 |
+
},
|
| 17 |
+
headers: {
|
| 18 |
+
'accept': '*/*'
|
| 19 |
+
}
|
| 20 |
+
});
|
| 21 |
+
|
| 22 |
+
if (response.data.success && response.data.data?.result?.token) {
|
| 23 |
+
return response.data.data.result.token;
|
| 24 |
+
}
|
| 25 |
+
throw new Error('Failed to get token from response');
|
| 26 |
} catch (error) {
|
| 27 |
throw new Error(`Failed to get bypass token: ${error.message}`);
|
| 28 |
}
|
|
|
|
| 196 |
|
| 197 |
module.exports = {
|
| 198 |
name: 'SunoV2 Music Generator',
|
|
|
|
| 199 |
type: 'GET',
|
| 200 |
routes: ['api/AI/sunov2'],
|
| 201 |
+
tags: ['ai', 'music', 'generator'],
|
| 202 |
main: ['AI'],
|
| 203 |
limit: 12,
|
| 204 |
parameters: ['mode', 'prompt', 'lyrics', 'title', 'style', 'instrumental', 'key'],
|