Closed mpirescarvalho closed 3 years ago
Solved. In order to send videos you have to give puppeteer the path to a separately installed Chrome browser
const client = new Client({
puppeteer: {
executablePath: '/path/to/Chrome',
}
})
I think this should be in the readme.
Solved. In order to send videos you have to give puppeteer the path to a separately installed Chrome browser
const client = new Client({ puppeteer: { executablePath: '/path/to/Chrome', } })
I think this should be in the readme.
Thanks for this, the path will be different from the path to Chrome in other users system depending their os, how do i get the path dynamically, rather than just hardcoding the path there?
Hi! Could somebody send me, please?
I've been using wweb.js library to send text messages, pictures and some files as PDF. Some mouths ago I tested to send videos and I dind´t get any problem. Yesterday I tried to send a video, but nothing happend not even a Error message, but I didn't received the video. I hope someone can help me.
Thanks!
My code:
async function enviarArchivo(number, filepath) {
if (!fs.existsSync(filepath)) throw new Error('El archivo no existe.');
var media;
extension = path.extname(filepath);
if(extension === ".mp4"){
const video = fs.readFileSync(filepath);
const mimeType = mime.lookup(filepath);
media = new MessageMedia(mimeType, video.toString('base64'), 'video.mp4');
} else media = MessageMedia.fromFilePath(filepath);
client.getNumberId(number).then((response) => {
destinatario = response._serialized;
console.log(media);
client.sendMessage(destinatario, media).then((response) => {
console.log('Mensaje enviado exitosamente:', response);
}).catch((error) => {
console.error('Error al enviar el mensaje:', error);
});
}).catch((error) => {
console.error(error);
});
}
Bug description
I'm getting this error when I try to send media messages with videos
Reproduction steps
My code looks like this:
I'm using this version of the library:
whatsapp-web.js": "^1.11.0
It's worth mention that I'm trying to send a
1.8mb
video, so I don't think the size is the problem