Comments (13)
@HypedMind I've now also seen this behaviour with video. It will take some investigating.
from wa-automate-nodejs.
@HypedMind classic buck bunny. That file doesnt work for some reason. If you use the sample and send your sulla'd number a video it should work fine. Maybe it's because of the codec? Does this specific file work in whatsapp web itself? It doesn't work in my instance of whatsapp web desktop client or the in chrome.
This worked fine for me: http://4ksamples.com/elysium-2013-2160p-1-minute-sample-footage/
from wa-automate-nodejs.
WAPI.sendMessageWithThumb
It can be useful, must be investigated
public async sendMessageWithThumb(base64Image: string, url: string, title: string, description: string, chatId: string, done?: string) {
return await this.page.evaluate(
({ base64Image, url, title, description, chatId }) => {
WAPI.sendSeen(chatId);
WAPI.sendMessageWithThumb(thumb, url, title, description, chatId)
},
{ base64Image, url, title, description, chatId }
);
}
from wa-automate-nodejs.
I did some finding on this, probably the web.whatsapp doesn't have the api available to send video as a 'video message', because using web.whatsapp in browser to send video also sends as a 'file message'.
from wa-automate-nodejs.
@HypedMind this is not entirely the case because sending a video file (received through WhatsApp) on WhatsApp web, it works properly with the preview.
Edit: actually most videos are working now. Maybe there was a bugfix?
from wa-automate-nodejs.
@smashah Yah the preview works fine. Probably WhatsApp decides that WhatsApp Web doesnโt need api to send video message, because only smartphone can capture video?
from wa-automate-nodejs.
@HypedMind I've been sending some videos to my other number on whatsapp web. Preview only didnt work for one specific video (that was received and saved by sulla-hotfix sample a few days ago).
from wa-automate-nodejs.
Just a thought: This may be due to user agent. My previous two comments were when testing on chrome whatsapp web. I tried with {headless:false} and i got this error message while sending a video with the chromium instance from puppeteer
from wa-automate-nodejs.
Further Investigation:
from wa-automate-nodejs.
Related:
alfred82santa/whalesong#58
from wa-automate-nodejs.
Ok, I've got it working properly with the demo/index.ts
Because pupeteer does not have any codecs that means that it cannot process videos for whatsapp. Why is this just happening now? I'm guessing that because Whatsapp doesn't want to be dealing with all the videos coming through, it now requires some pre processing on the client (phone or web).
There's two ways to solve this.
- Fool whatsapp web into thinking it's been processed with puppeteer.
- Use an instance of chrome instead of chromium for puppeteer.
I have no clue right now to do number 1. But 2 works fine, all you need to do is tell sulla-hotfix where your chrome instance is. Here is the solution for my mac. If you're running this on a server, make sure chrome is installed.
create('session',{
executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
}).then(client => start(client));
The good thing about this is that it will not require an update. However I have been testing with puppeteer dependency to latest version (don't think it should make much diff though).
@HypedMind @paramirez Let me know if this works for you.
I will update the documentation soon. It's kinda annoying but it's definitely a long term solution.
Thanks for bringing up the issue and helping with investigation!
from wa-automate-nodejs.
Hey @smashah , sorry now only I have the time to check.
I just tried with your solution, however I can't get it to work, the message rendered as a 'file' message instead of a 'video' message.
Would you able to share the video file that you use?
My sulla.create:
var client = await sulla.create(session_id,
{
executablePath: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
},
customUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36"
);
My sendFile code:
await client.sendFile(
{number},
base64,
"",
""
);
My video file: http://s000.tinyupload.com/index.php?file_id=53242422432601226909
My base64 string: https://freetexthost.net/kHHzVgU
My chrome version: https://i.imgur.com/hbBwEVX.png
from wa-automate-nodejs.
@smashah Turns out the video I used actually has issue. I got it working with other video files.
I was able to send out video as 'video message' in Ubuntu server.
This was how I did it:
-
Install Chrome in Ubuntu following this tutorial: https://www.linuxbabe.com/ubuntu/install-google-chrome-ubuntu-16-04-lts
-
Create sulla client using the executable path:
var client = await sulla.create(session_id,
{
executablePath: "/opt/google/chrome/chrome",
}
)
from wa-automate-nodejs.
Related Issues (20)
- QR does not appear HOT 3
- Not getting scanner/QR HOT 8
- I'm stuck on authenticating HOT 2
- frame nav breaks launch HOT 2
- client.inviteInfo return undefined HOT 2
- await Client.getAllUnreadMessages() returning "Error [TypeError]: _0x30d707[("NyC" + "SU")](...) is not a function" HOT 1
- await Client.getAmountOfLoadedMessages() returns error "Error [TypeError]: Cannot read properties of undefined (reading 'length')"
- There are some launch regressions in 4.71.1 HOT 15
- sendTextWithMentions() returns "Error [TypeError]: Store[("add" + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + "t")] is not a function" HOT 1
- client.deleteMessage() returns Error [TypeError]: mmrrf(...) is not a function HOT 1
- code based login (instead of qr code)
- approveGroupJoinRequest() returns error TypeError: _0x461cc2[("moZ" + "AY")](...) is not a function
- linkpreview improvements HOT 2
- Regarding licensing.
- [insiders] feat: `sendStoryWithThumb` HOT 3
- Not able to send message using .sendText method. | PS: have not purchased any license or anything. HOT 1
- WA not functioning after update
- forwardmessages not working on 4.71.0 - 4.71.10
- Client.getAllUnreadMessages() returns: TypeError: Cannot read properties of undefined (reading 'profilePicFind')
- Memory leak + cannot receive any message HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wa-automate-nodejs.