wppconnect-team / wa-js

WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web
https://wppconnect.io/wa-js/
Apache License 2.0
418 stars 134 forks source link

Error when sending mp4 video by PTV type #1343

Closed DXPRO closed 12 months ago

DXPRO commented 1 year ago

Description

When trying to send a video in mp4 format using the wa-js sendfile by type ptv, in some cases it presents invalid type errors or just the message that it was not possible to send the file

Environment

Steps to Reproduce

1 - First step is to inject the wa-js in the browser console by shortcut Ctrl + Shift + J

2 - Second step is to take the video file and transform it into base64 with the correct datatype, I use the site below: https://base64.guru/converter/encode/video as shown in the screenshot: Screenshot

3 - In the third and final step, I paste the function with the id of a group and the base64 file into the console:

// The PTV Video (micro video) WPP.chat.sendFileMessage( '120363159509749924@g.us', 'data:application/msword;base64,', { type: 'ptv', } );

Log Output

In the output log it shows the message that I present in the screenshot:
https://prnt.sc/0OEGsKgyef5e

It did not generate any errors this time, but it did not send the video, in other cases it shows that it generated an invalid media format error

Your Code

If relevant, paste all of your challenge code in here

Additional context / Screenshot

Add any other context about the problem here. If applicable, add screenshots to help explain.

boinaweb commented 1 year ago

There is a way to not give an error, send the mp4 video to your personal number without being ptv, then try to send ptv again without errors, I believe that it stores it temporarily there it ends up recognizing it as valid media.

icleitoncosta commented 1 year ago

Today I ran some tests, but with no success. Only by sending the message first as a video and then resending it as 'ptv' does it work. I need to investigate further, but I haven't given up.