mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
Improved error handling on youtube.js
This commit is contained in:
parent
b4db2642fd
commit
a36e1825b9
@ -68,6 +68,13 @@ module.exports = (bot) => {
|
|||||||
const dlpCommand = ytDlpPath;
|
const dlpCommand = ytDlpPath;
|
||||||
const ffmpegPath = getFfmpegPath();
|
const ffmpegPath = getFfmpegPath();
|
||||||
const ffmpegArgs = ['-i', tempMp4File, '-i', tempWebmFile, '-c:v copy -c:a copy -strict -2', mp4File];
|
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"))) {
|
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";
|
cmdArgs = "--max-filesize 2G --no-playlist --cookies src/props/cookies.txt --merge-output-format mp4 -o";
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
"ytDownloadErr": "*Error during YT video download:*\n\n`{err}`",
|
"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.*",
|
"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.*",
|
"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}```",
|
"botUpdated": "Bot updated with success.\n\n```{result}```",
|
||||||
"errorUpdatingBot": "Error updating bot\n\n{error}",
|
"errorUpdatingBot": "Error updating bot\n\n{error}",
|
||||||
"catImgErr": "Sorry, but I couldn't get the cat photo you wanted.",
|
"catImgErr": "Sorry, but I couldn't get the cat photo you wanted.",
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
"ytDownloadErr": "*Erro durante o download do vídeo do YT:*\n\n`{err}`",
|
"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.*",
|
"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.*",
|
"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}```",
|
"botUpdated": "Bot atualizado com sucesso.\n\n```{result}```",
|
||||||
"errorUpdatingBot": "Erro ao atualizar o bot\n\n{error}",
|
"errorUpdatingBot": "Erro ao atualizar o bot\n\n{error}",
|
||||||
"catImgErr": "Desculpe, mas não consegui obter a foto do gato que você queria.",
|
"catImgErr": "Desculpe, mas não consegui obter a foto do gato que você queria.",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user