Improved error handling on youtube.js

This commit is contained in:
Luquinhas 2025-01-10 09:21:37 -03:00
parent b4db2642fd
commit a36e1825b9
No known key found for this signature in database
GPG key ID: D9B075FC6DC93985
3 changed files with 9 additions and 2 deletions

View file

@ -68,6 +68,13 @@ module.exports = (bot) => {
const dlpCommand = ytDlpPath;
const ffmpegPath = getFfmpegPath();
const ffmpegArgs = ['-i', tempMp4File, '-i', tempWebmFile, '-c:v copy -c:a copy -strict -2', mp4File];
if (!videoUrl) {
return ctx.reply(Strings.ytNoLink, {
parse_mode: "Markdown",
disable_web_page_preview: true,
reply_to_message_id: ctx.message.message_id
});
};
if (fs.existsSync(path.resolve(__dirname, "../props/cookies.txt"))) {
cmdArgs = "--max-filesize 2G --no-playlist --cookies src/props/cookies.txt --merge-output-format mp4 -o";