Comando JSON

case 'hdvideo':
try {//By: 𖧄 𝐋𝐔𝐂𝐀𝐒 𝐌𝐎𝐃 𝐃𝐎𝐌𝐈𝐍𝐀 𖧄
if ((isMedia && info.message.videoMessage) || isQuotedVideo) {
let post = isQuotedVideo
? JSON.parse(JSON.stringify(info).replace('quotedM', 'm')).message.extendedTextMessage.contextInfo.message.videoMessage : info.message.videoMessage
reply('😈 _Processando seu vídeo! Aguarde..._')
const videoStream = await downloadContentFromMessage(post, 'video')
let videoBuffer = Buffer.from([])
for await (const chunk of videoStream) {
videoBuffer = Buffer.concat([videoBuffer, chunk])
}
const videoLink = await upload(videoBuffer)
const response = await fetch(`${zerosite}/api/ia/tohdvideo?link=${videoLink}&apikey=${API_KEY_ZEROTWO}`)
const arrayBuffer = await response.arrayBuffer()
const buffer = Buffer.from(arrayBuffer)
const tempFilePath = path.join(os.tmpdir(), 'processed-video.mp4')
fs.writeFileSync(tempFilePath, buffer)
await zerotwo.sendMessage(from, { video: { url: tempFilePath } }, { quoted: info })
fs.unlinkSync(tempFilePath)
} else {
reply('😈 _Marque o vídeo para eu poder aplicar o filtro do Remini_')
}
} catch (e) {
console.log(e)
return reply("Erro ao processar o vídeo.")
}
break
> Loading... > Processing... > Completed... > Error... > Done...