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");