mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 04:39:57 +00:00
Put all strings of YouTube downloader on another JSON object
This commit is contained in:
parent
b5e220b284
commit
31c69ab6c6
@ -70,7 +70,7 @@ module.exports = (bot) => {
|
|||||||
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) {
|
if (!videoUrl) {
|
||||||
return ctx.reply(Strings.ytNoLink, {
|
return ctx.reply(Strings.ytDownload.noLink, {
|
||||||
parse_mode: "Markdown",
|
parse_mode: "Markdown",
|
||||||
disable_web_page_preview: true,
|
disable_web_page_preview: true,
|
||||||
reply_to_message_id: ctx.message.message_id
|
reply_to_message_id: ctx.message.message_id
|
||||||
@ -84,7 +84,7 @@ module.exports = (bot) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const downloadingMessage = await ctx.reply(Strings.ytCheckingSize, {
|
const downloadingMessage = await ctx.reply(Strings.ytDownload.checkingSize, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id,
|
reply_to_message_id: ctx.message.message_id,
|
||||||
});
|
});
|
||||||
@ -98,7 +98,7 @@ module.exports = (bot) => {
|
|||||||
ctx.chat.id,
|
ctx.chat.id,
|
||||||
downloadingMessage.message_id,
|
downloadingMessage.message_id,
|
||||||
null,
|
null,
|
||||||
Strings.ytDownloading, {
|
Strings.ytDownload.downloadingVid, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id,
|
reply_to_message_id: ctx.message.message_id,
|
||||||
},
|
},
|
||||||
@ -111,7 +111,7 @@ module.exports = (bot) => {
|
|||||||
ctx.chat.id,
|
ctx.chat.id,
|
||||||
downloadingMessage.message_id,
|
downloadingMessage.message_id,
|
||||||
null,
|
null,
|
||||||
Strings.ytUploading, {
|
Strings.ytDownload.uploadingVid, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id,
|
reply_to_message_id: ctx.message.message_id,
|
||||||
},
|
},
|
||||||
@ -122,7 +122,7 @@ module.exports = (bot) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fs.existsSync(mp4File)) {
|
if (fs.existsSync(mp4File)) {
|
||||||
const message = Strings.ytUploadDesc.replace("{userMention}", `[${ctx.from.first_name}](tg://user?id=${userId})`)
|
const message = Strings.ytDownload.msgDesc.replace("{userMention}", `[${ctx.from.first_name}](tg://user?id=${userId})`)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await ctx.replyWithVideo({
|
await ctx.replyWithVideo({
|
||||||
@ -136,7 +136,7 @@ module.exports = (bot) => {
|
|||||||
ctx.chat.id,
|
ctx.chat.id,
|
||||||
downloadingMessage.message_id,
|
downloadingMessage.message_id,
|
||||||
null,
|
null,
|
||||||
Strings.ytUploadLimit2, {
|
Strings.ytDownload.sizeLimitWarn, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id,
|
reply_to_message_id: ctx.message.message_id,
|
||||||
},
|
},
|
||||||
@ -150,7 +150,7 @@ module.exports = (bot) => {
|
|||||||
ctx.chat.id,
|
ctx.chat.id,
|
||||||
downloadingMessage.message_id,
|
downloadingMessage.message_id,
|
||||||
null,
|
null,
|
||||||
Strings.ytUploadLimit, {
|
Strings.ytDownload.uploadLimit, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id,
|
reply_to_message_id: ctx.message.message_id,
|
||||||
},
|
},
|
||||||
@ -160,7 +160,7 @@ module.exports = (bot) => {
|
|||||||
ctx.chat.id,
|
ctx.chat.id,
|
||||||
downloadingMessage.message_id,
|
downloadingMessage.message_id,
|
||||||
null,
|
null,
|
||||||
Strings.ytFileError, {
|
Strings.ytDownload.uploadErr, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id,
|
reply_to_message_id: ctx.message.message_id,
|
||||||
},
|
},
|
||||||
@ -180,7 +180,7 @@ module.exports = (bot) => {
|
|||||||
ctx.chat.id,
|
ctx.chat.id,
|
||||||
downloadingMessage.message_id,
|
downloadingMessage.message_id,
|
||||||
null,
|
null,
|
||||||
Strings.ytLibNotFound, {
|
Strings.ytDownload.libNotFound, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id,
|
reply_to_message_id: ctx.message.message_id,
|
||||||
},
|
},
|
||||||
@ -188,7 +188,7 @@ module.exports = (bot) => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
await ctx.reply(Strings.ytFileError, {
|
await ctx.reply(Strings.ytDownload.uploadErr, {
|
||||||
parse_mode: 'Markdown',
|
parse_mode: 'Markdown',
|
||||||
reply_to_message_id: ctx.message.message_id,
|
reply_to_message_id: ctx.message.message_id,
|
||||||
});
|
});
|
||||||
|
@ -65,24 +65,26 @@
|
|||||||
"funnyCommandsDesc": "*Funny commands*\n\n- /gay: Check if you are gay\n- /furry: Check if you are a furry\n- /random: Pick a random number between 0-10",
|
"funnyCommandsDesc": "*Funny commands*\n\n- /gay: Check if you are gay\n- /furry: Check if you are a furry\n- /random: Pick a random number between 0-10",
|
||||||
"interactiveEmojis": "Interactive emojis",
|
"interactiveEmojis": "Interactive emojis",
|
||||||
"interactiveEmojisDesc": "*Interactive emojis*\n\n- /dice: Roll a dice\n- /idice: Infinitely roll a colored dice\n- /slot: Try to combine the figures!\n- /ball: Try to kick the ball into the goal!\n- /bowling: Try to hit the pins!\n- /dart: Try to hit the target!",
|
"interactiveEmojisDesc": "*Interactive emojis*\n\n- /dice: Roll a dice\n- /idice: Infinitely roll a colored dice\n- /slot: Try to combine the figures!\n- /ball: Try to kick the ball into the goal!\n- /bowling: Try to hit the pins!\n- /dart: Try to hit the target!",
|
||||||
"ytDlp": "Video download",
|
|
||||||
"ytDlpDesc": "*Video download*\n\n- /yt | /ytdl | /sdl | /dl | /video `<video link>`: Download a video from some platforms (e.g. YouTube, Instagram, Facebook, etc.).\n\n See [this link](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) for more information and which services are supported.\n\n*Note: Telegram is currently limiting bot uploads to 50MB, which means that if the video you want to download is larger than 50MB, the quality will be reduced to try to upload it anyway. We're trying our best to work around or fix this problem.*",
|
|
||||||
"animalCommands": "Animals",
|
"animalCommands": "Animals",
|
||||||
"animalCommandsDesc": "*Animals*\n\n- /soggy | /soggycat `<1 | 2 | 3 | 4 | orig | thumb | sticker | alt>`: Sends the [Soggy cat meme](https://knowyourmeme.com/memes/soggy-cat)\n - /cat `<tags>`: Sends a random picture of a cat. You can specify some tags, separating each by a comma. Example: `/cat orange, cute`\n- /dog: Sends a random picture of a dog.\n- /httpcat `<http code>`: Send cat memes from http.cat with your specified HTTP code. Example: `/httpcat 404`",
|
"animalCommandsDesc": "*Animals*\n\n- /soggy | /soggycat `<1 | 2 | 3 | 4 | orig | thumb | sticker | alt>`: Sends the [Soggy cat meme](https://knowyourmeme.com/memes/soggy-cat)\n - /cat `<tags>`: Sends a random picture of a cat. You can specify some tags, separating each by a comma. Example: `/cat orange, cute`\n- /dog: Sends a random picture of a dog.\n- /httpcat `<http code>`: Send cat memes from http.cat with your specified HTTP code. Example: `/httpcat 404`",
|
||||||
"myLittlePony": "My Little Pony",
|
"myLittlePony": "My Little Pony",
|
||||||
"myLittlePonyDesc": "*My Little Pony*\n\n- /mlp: Displays this help message.\n- /mlpchar `<character name>`: Shows specific information about a My Little Pony character. Example: `/mlpchar twilight`\n- /mlpep: Shows specific information about a My Little Pony episode. Example: `/mlpep 136`",
|
"myLittlePonyDesc": "*My Little Pony*\n\n- /mlp: Displays this help message.\n- /mlpchar `<character name>`: Shows specific information about a My Little Pony character. Example: `/mlpchar twilight`\n- /mlpep: Shows specific information about a My Little Pony episode. Example: `/mlpep 136`",
|
||||||
"maInvalidModule": "Please provide a valid module ID from The Mod Archive.\nExample: `/modarchive 81574`",
|
"maInvalidModule": "Please provide a valid module ID from The Mod Archive.\nExample: `/modarchive 81574`",
|
||||||
"maDownloadError": "Error downloading the file. Check the module ID and try again.",
|
"maDownloadError": "Error downloading the file. Check the module ID and try again.",
|
||||||
"ytDownloading": "*Downloading video...*",
|
"ytDownload": {
|
||||||
"ytLibNotFound": "*It seems that the yt-dlp executable does not exist on our server...\n\nIn that case, the problem is on our end! Please wait until we have noticed and solved the problem.*",
|
"helpEntry": "Video download",
|
||||||
"ytCheckingSize": "*Checking if the video exceeds the 50MB limit...*",
|
"helpDesc": "*Video download*\n\n- /yt | /ytdl | /sdl | /dl | /video `<video link>`: Download a video from some platforms (e.g. YouTube, Instagram, Facebook, etc.).\n\n See [this link](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) for more information and which services are supported.\n\n*Note: Telegram is currently limiting bot uploads to 50MB, which means that if the video you want to download is larger than 50MB, the quality will be reduced to try to upload it anyway. We're trying our best to work around or fix this problem.*",
|
||||||
"ytUploading": "*Uploading video...*",
|
"downloadingVid": "*Downloading video...*",
|
||||||
"ytUploadDesc": "{userMention}*, there is your downloaded video.*",
|
"libNotFound": "*It seems that the yt-dlp executable does not exist on our server...\n\nIn that case, the problem is on our end! Please wait until we have noticed and solved the problem.*",
|
||||||
"ytDownloadErr": "*Error during YT video download:*\n\n`{err}`",
|
"checkingSize": "*Checking if the video exceeds the 50MB 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.*",
|
"uploadingVid": "*Uploading video...*",
|
||||||
"ytUploadLimit2": "*This video had its quality reduced because it exceeded the 50MB limit for uploads imposed by Telegram.*",
|
"msgDesc": "{userMention}*, there is your downloaded video.*",
|
||||||
"ytNoLink": "Please provide a link to a video to download.",
|
"downloadErr": "*Error during YT video download:*\n\n`{err}`",
|
||||||
"ytFileError": "Error uploading file. Please try again later.",
|
"uploadErr": "Error uploading file. Please try again later.",
|
||||||
|
"uploadLimit": "*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.*",
|
||||||
|
"sizeLimitWarn": "*This video had its quality reduced because it exceeded the 50MB limit for uploads imposed by Telegram.*",
|
||||||
|
"noLink": "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.",
|
||||||
|
@ -65,24 +65,26 @@
|
|||||||
"funnyCommandsDesc": "*Comandos engraçados*\n\n- /gay: Verifique se você é gay\n- /furry: Verifique se você é furry\n- /random: Escolhe um número aleatório entre 0-10",
|
"funnyCommandsDesc": "*Comandos engraçados*\n\n- /gay: Verifique se você é gay\n- /furry: Verifique se você é furry\n- /random: Escolhe um número aleatório entre 0-10",
|
||||||
"interactiveEmojis": "Emojis interativos",
|
"interactiveEmojis": "Emojis interativos",
|
||||||
"interactiveEmojisDesc": "*Emojis interativos*\n\n- /dice: Jogue um dado\n- /idice: Role infinitamente um dado colorido\n- /slot: Tente combinar as figuras!\n- /ball: Tente chutar a bola no gol!\n- /bowling: Tente derrubar os pinos!\n- /dart: Tente acertar o alvo!",
|
"interactiveEmojisDesc": "*Emojis interativos*\n\n- /dice: Jogue um dado\n- /idice: Role infinitamente um dado colorido\n- /slot: Tente combinar as figuras!\n- /ball: Tente chutar a bola no gol!\n- /bowling: Tente derrubar os pinos!\n- /dart: Tente acertar o alvo!",
|
||||||
"ytDlp": "Download de vídeos",
|
|
||||||
"ytDlpDesc": "*Download de vídeos*\n\n- /yt | /ytdl | /sdl | /dl | /video `<link do vídeo>`: Baixa um vídeo de algumas plataformas (ex: YouTube, Instagram, Facebook, etc.).\n\nConsulte [este link](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) para obter mais informações e saber quais serviços são compatíveis.\n\n*Nota: O Telegram está atualmente limitando os uploads de bots a 50MB, o que significa que se o vídeo que você deseja baixar for maior que 50MB, a qualidade será reduzida para tentar carregá-lo de qualquer maneira. Estamos fazendo o possível para contornar ou corrigir esse problema.*",
|
|
||||||
"animalCommands": "Animais",
|
"animalCommands": "Animais",
|
||||||
"animalCommandsDesc": "*Animais*\n\n- /soggy | /soggycat `<1 | 2 | 3 | 4 | orig | thumb | sticker | alt>`: Envia o [meme do gato encharcado](https://knowyourmeme.com/memes/soggy-cat)\n- /cat `<tags>` - Envia uma foto aleatória de um gato. Você pode especificar algumas tags em inglês, separando cada uma por uma vírgula. Exemplo: `/cat orange, cute`\n- /dog - Envia uma imagem aleatória de um cachorro.\n- /httpcat `<código http>`: Envia memes de gato do http.cat com o código HTTP especificado. Exemplo: `/httpcat 404`",
|
"animalCommandsDesc": "*Animais*\n\n- /soggy | /soggycat `<1 | 2 | 3 | 4 | orig | thumb | sticker | alt>`: Envia o [meme do gato encharcado](https://knowyourmeme.com/memes/soggy-cat)\n- /cat `<tags>` - Envia uma foto aleatória de um gato. Você pode especificar algumas tags em inglês, separando cada uma por uma vírgula. Exemplo: `/cat orange, cute`\n- /dog - Envia uma imagem aleatória de um cachorro.\n- /httpcat `<código http>`: Envia memes de gato do http.cat com o código HTTP especificado. Exemplo: `/httpcat 404`",
|
||||||
"myLittlePony": "My Little Pony",
|
"myLittlePony": "My Little Pony",
|
||||||
"myLittlePonyDesc": "*My Little Pony*\n\n- /mlp: Exibe esta mensagem de ajuda.\n- /mlpchar `<nome do personagem>`: Mostra informações específicas sobre um personagem de My Little Pony em inglês. Exemplo: `/mlpchar twilight`\n- /mlpep: Mostra informações específicas sobre um episódio de My Little Pony em inglês. Exemplo: `/mlpep 136`",
|
"myLittlePonyDesc": "*My Little Pony*\n\n- /mlp: Exibe esta mensagem de ajuda.\n- /mlpchar `<nome do personagem>`: Mostra informações específicas sobre um personagem de My Little Pony em inglês. Exemplo: `/mlpchar twilight`\n- /mlpep: Mostra informações específicas sobre um episódio de My Little Pony em inglês. Exemplo: `/mlpep 136`",
|
||||||
"maInvalidModule": "Por favor, forneça um ID de módulo válido do The Mod Archive.\nExemplo: `/modarchive 81574`",
|
"maInvalidModule": "Por favor, forneça um ID de módulo válido do The Mod Archive.\nExemplo: `/modarchive 81574`",
|
||||||
"maDownloadError": "Erro ao baixar o arquivo. Verifique o ID do módulo e tente novamente.",
|
"maDownloadError": "Erro ao baixar o arquivo. Verifique o ID do módulo e tente novamente.",
|
||||||
"ytDownloading": "*Baixando vídeo...*",
|
"ytDownload": {
|
||||||
"ytCheckingSize": "Verificando se o vídeo excede o limite de 50 MB...",
|
"helpEntry": "Download de vídeos",
|
||||||
"ytLibNotFound": "*Parece que o executável do yt-dlp não existe no nosso servidor...\n\nNesse caso, o problema está no nosso lado! Aguarde até que tenhamos notado e resolvido o problema.*",
|
"helpDesc": "*Download de vídeos*\n\n- /yt | /ytdl | /sdl | /dl | /video `<link do vídeo>`: Baixa um vídeo de algumas plataformas (ex: YouTube, Instagram, Facebook, etc.).\n\nConsulte [este link](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md) para obter mais informações e saber quais serviços são compatíveis.\n\n*Nota: O Telegram está atualmente limitando os uploads de bots a 50MB, o que significa que se o vídeo que você deseja baixar for maior que 50MB, a qualidade será reduzida para tentar carregá-lo de qualquer maneira. Estamos fazendo o possível para contornar ou corrigir esse problema.*",
|
||||||
"ytUploading": "*Enviando vídeo...*",
|
"downloadingVid": "*Baixando vídeo...*",
|
||||||
"ytUploadDesc": "{userMention}*, aqui está o seu vídeo baixado.*",
|
"libNotFound": "*Parece que o executável do yt-dlp não existe no nosso servidor...\n\nNesse caso, o problema está no nosso lado! Aguarde até que tenhamos notado e resolvido o problema.*",
|
||||||
"ytDownloadErr": "*Erro durante o download do vídeo do YT:*\n\n`{err}`",
|
"checkingSize": "Verificando se o vídeo excede o limite de 50 MB...",
|
||||||
"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.*",
|
"uploadingVid": "*Enviando vídeo...*",
|
||||||
"ytUploadLimit2": "*Esse vídeo teve a qualidade reduzida por estar excedendo o limite de 50MB para uploads imposto pelo Telegram.*",
|
"msgDesc": "{userMention}*, aqui está o seu vídeo baixado.*",
|
||||||
"ytNoLink": "*Por favor, forneça um link de um vídeo para download.*",
|
"downloadErr": "*Erro durante o download do vídeo do YT:*\n\n`{err}`",
|
||||||
"ytFileError": "Erro ao enviar o arquivo. Tente novamente mais tarde.",
|
"uploadErr": "Erro ao enviar o arquivo. Tente novamente mais tarde.",
|
||||||
|
"uploadLimit": "*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.*",
|
||||||
|
"sizeLimitWarn": "*Esse vídeo teve a qualidade reduzida por estar excedendo o limite de 50MB para uploads imposto pelo Telegram.*",
|
||||||
|
"noLink": "*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