Version 1.1.2-rc4 - Ajout de agent Cookie

This commit is contained in:
2025-08-29 19:41:08 +02:00
parent c376e3259c
commit 5ac195fd46
2 changed files with 4 additions and 5 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "chopin-backend",
"version": "1.1.1",
"version": "1.1.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "chopin-backend",
"version": "1.1.1",
"version": "1.1.2",
"license": "ISC",
"dependencies": {
"@discordjs/voice": "^0.18.0",

View File

@@ -18,8 +18,8 @@ async function getStream(song) {
'Chrome/116.0.5845.97 Safari/537.36',
'Accept-Language': 'en-US,en;q=0.9'
};
var cookies = await JSON.parse(await fs.readFileSync(__glob.COOKIES, 'utf-8'));
var cookies = await JSON.parse(await fs.readFileSync(__glob.COOKIES, 'utf-8'));
ytdl.createAgent(cookies)
let stream = ytdl(song.url, {
quality: 'highestaudio',
highWaterMark: 1 << 30,
@@ -28,7 +28,6 @@ async function getStream(song) {
bitrate: 128,
requestOptions: {
headers: headers,
cookies: cookies
}
});