GithubHelp home page GithubHelp logo

Sending video about wa-automate-nodejs HOT 13 CLOSED

open-wa avatar open-wa commented on July 21, 2024
Sending video

from wa-automate-nodejs.

Comments (13)

smashah avatar smashah commented on July 21, 2024 2

@HypedMind I've now also seen this behaviour with video. It will take some investigating.

from wa-automate-nodejs.

smashah avatar smashah commented on July 21, 2024 1

@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.

paramirez avatar paramirez commented on July 21, 2024

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.

HypedMind avatar HypedMind commented on July 21, 2024

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.

smashah avatar smashah commented on July 21, 2024

@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.

HypedMind avatar HypedMind commented on July 21, 2024

@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.

smashah avatar smashah commented on July 21, 2024

@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.

smashah avatar smashah commented on July 21, 2024

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

image

from wa-automate-nodejs.

smashah avatar smashah commented on July 21, 2024

Further Investigation:

image

from wa-automate-nodejs.

smashah avatar smashah commented on July 21, 2024

Related:
alfred82santa/whalesong#58

from wa-automate-nodejs.

smashah avatar smashah commented on July 21, 2024

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.

  1. Fool whatsapp web into thinking it's been processed with puppeteer.
  2. 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.

HypedMind avatar HypedMind commented on July 21, 2024

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.

HypedMind avatar HypedMind commented on July 21, 2024

@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:

  1. Install Chrome in Ubuntu following this tutorial: https://www.linuxbabe.com/ubuntu/install-google-chrome-ubuntu-16-04-lts

  2. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.