From 4e6b337d4fc589e4cebaa2fa22aed31a4d90520b Mon Sep 17 00:00:00 2001 From: Flummi Date: Mon, 1 May 2023 15:51:41 +0200 Subject: [PATCH] failsaphe --- src/inc/trigger/parser.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/inc/trigger/parser.mjs b/src/inc/trigger/parser.mjs index 5e9a9c2..a1d096f 100644 --- a/src/inc/trigger/parser.mjs +++ b/src/inc/trigger/parser.mjs @@ -113,17 +113,18 @@ export default async bot => { try { if(mime == 'video/x-matroska') { // mkv failsafe await queue.exec(`ffmpeg -i ./tmp/${uuid}.mkv -codec copy ./tmp/${uuid}.mp4`); - await fs.promises.unlink(source); + await fs.promises.unlink(source).catch(_=>{}); source = source.replace(/\.mkv$/, '.mp4'); mime = 'video/mp4'; } - if(source.match(/\.opus$/)) { // opus failsave + if(source.match(/\.opus$/)) { // opus failsafe await queue.exec(`ffmpeg -i ./tmp/${uuid}.opus -codec copy ./tmp/${uuid}.ogg`); await fs.promises.unlink(source); source = source.replace(/\.opus$/, '.ogg'); mime = 'audio/ogg'; } } catch(err) { + await fs.promises.unlink(source).catch(_=>{}); if(e.type == 'tg') return await e.editMessageText(msg.result.chat.id, msg.result.message_id, "something went wrong lol"); return await e.reply("something went wrong lol");