Version 1.1.3 - Modfication du Proxy
All checks were successful
Deployment Pipeline / deploy (push) Successful in 36s
All checks were successful
Deployment Pipeline / deploy (push) Successful in 36s
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "chopin-backend",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"description": "Discord Bot for music - Fetching everywhere !",
|
||||
"main": "src/main.js",
|
||||
"nodemonConfig": {
|
||||
|
@@ -2,7 +2,6 @@ const {createAudioResource, VoiceConnectionStatus, createAudioPlayer, StreamType
|
||||
const {LogType} = require('loguix')
|
||||
const clog = new LogType("Youtube-Stream")
|
||||
const ytdl = require('@distube/ytdl-core')
|
||||
const { getRandomIPv6 } = require("@distube/ytdl-core/lib/utils");
|
||||
const { __glob } = require('../../utils/GlobalVars');
|
||||
const fs = require('fs');
|
||||
|
||||
@@ -18,8 +17,10 @@ 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'));
|
||||
ytdl.createAgent(cookies)
|
||||
const proxy = await JSON.parse(await fs.readFileSync(__glob.PROXY, 'utf-8'));
|
||||
const agent = ytdl.createProxyAgent(proxy, cookies)
|
||||
let stream = ytdl(song.url, {
|
||||
quality: 'highestaudio',
|
||||
highWaterMark: 1 << 30,
|
||||
@@ -28,7 +29,8 @@ async function getStream(song) {
|
||||
bitrate: 128,
|
||||
requestOptions: {
|
||||
headers: headers,
|
||||
}
|
||||
},
|
||||
agent: agent,
|
||||
});
|
||||
|
||||
return stream
|
||||
|
@@ -17,7 +17,8 @@ const __glob = {
|
||||
MEDIA_DB: root + path.sep + "data" + path.sep + "media.json",
|
||||
VERSION: version,
|
||||
CHANGELOG_PATH: root + path.sep + "CHANGELOG.html",
|
||||
COOKIES: root + path.sep + "data" + path.sep + "cookies.json"
|
||||
COOKIES: root + path.sep + "data" + path.sep + "cookies.json",
|
||||
PROXY: root + path.sep + "data" + path.sep + "proxy.json"
|
||||
}
|
||||
|
||||
module.exports = {__glob}
|
Reference in New Issue
Block a user