Improved error handling on youtube.js

This commit is contained in:
Lucas Gabriel 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";

View File

@ -77,7 +77,7 @@
"ytDownloadErr": "*Error during YT video download:*\n\n`{err}`",
"ytUploadLimit": "*This video exceeds the 50 MB upload limit imposed by Telegram on our bot. Please try another video. We're doing our best to increase this limit.*",
"ytUploadLimit2": "*This video had its quality reduced because it exceeded the 50MB limit for uploads imposed by Telegram.*",
"fileError": "Error uploading file",
"ytNoLink": "Please provide a link to a video to download.",
"botUpdated": "Bot updated with success.\n\n```{result}```",
"errorUpdatingBot": "Error updating bot\n\n{error}",
"catImgErr": "Sorry, but I couldn't get the cat photo you wanted.",

View File

@ -77,7 +77,7 @@
"ytDownloadErr": "*Erro durante o download do vídeo do YT:*\n\n`{err}`",
"ytUploadLimit": "*Este vídeo excede o limite de carregamento de 50 MB imposto pelo Telegram ao nosso bot. Por favor, tente outro vídeo. Estamos fazendo o possível para aumentar esse limite.*",
"ytUploadLimit2": "*Esse vídeo teve a qualidade reduzida por estar excedendo o limite de 50MB para uploads imposto pelo Telegram.*",
"fileError": "Erro ao enviar o arquivo",
"ytNoLink": "*Por favor, forneça um link de um vídeo para download.*",
"botUpdated": "Bot atualizado com sucesso.\n\n```{result}```",
"errorUpdatingBot": "Erro ao atualizar o bot\n\n{error}",
"catImgErr": "Desculpe, mas não consegui obter a foto do gato que você queria.",