mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-18 05:26:00 +00:00
Validate url
Validate url for precise song accuracy when using a link to play a song
This commit is contained in:
@ -60,4 +60,4 @@ module.exports = async function (
|
||||
return msg.channel.send(client.messages.error);
|
||||
}
|
||||
return;
|
||||
};
|
||||
};
|
@ -1,7 +1,5 @@
|
||||
module.exports = async function (guild, song, client, seek, play) {
|
||||
const {
|
||||
Readable: ReadableStream
|
||||
} = require("stream");
|
||||
const { Readable: ReadableStream } = require("stream");
|
||||
const Discord = require("discord.js");
|
||||
const ytdl = require("ytdl-core");
|
||||
const streamConfig = require("../config/streamConfig.js");
|
||||
@ -16,8 +14,7 @@ module.exports = async function (guild, song, client, seek, play) {
|
||||
streamConfig.options.seek = seek;
|
||||
|
||||
let input = song.url;
|
||||
if (song.type === "ytdl")
|
||||
input = ytdl(song.url, streamConfig.ytdlOptions);
|
||||
if (song.type === "ytdl") input = ytdl(song.url, streamConfig.ytdlOptions);
|
||||
|
||||
const ffmpegArgs = [
|
||||
"-analyzeduration",
|
||||
@ -78,4 +75,4 @@ module.exports = async function (guild, song, client, seek, play) {
|
||||
queue.textChannel.send(embed);
|
||||
}
|
||||
queue.playing = true;
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user