vasani-arpit / WBOT

A simple Web based BOT for WhatsApp™ in NodeJS 😜. Working as of 📅 Feb 4th, 2024
Other
986 stars 314 forks source link

I cannot see the videos in the states or in the conversations #215

Closed jasp402 closed 3 years ago

jasp402 commented 3 years ago

I have reviewed the code, in fact I decided to write everything from the beginning, but the issue is directly with the Chromium. Remove all attributes but remain the same.

["--app = https: //web.whatsapp.com", "--disable-gpu", "--renderer", "--no-sandbox", "--no-service-autorun", "--no-experiments", "--no-default-browser-check", "--disable-webgl", "--disable-threaded-animation", "--disable-threaded-scrolling", "--disable-in-process-stack-traces", "--disable-histogram-customizer", "--disable-gl-extensions", "--disable-extensions", "--disable-composited-antialiasing", "--disable-canvas-aa", "--disable-3d-apis", "--disable-accelerated-2d-canvas", "--disable-accelerated-jpeg-decoding", "--disable-accelerated-mjpeg-decode", "--disable-app-list-dismiss-on-blur", "--disable-accelerated-video-decode", "--num-raster-threads = 1"] I also tried to change the property of userAgent but it didn't give me any results either.

There is a rejection of the request from WhatsApp. but I can't determine what generates it. image image

I would like to be able to help more to solve this problem but I do not have much knowledge regarding Chromium

vasani-arpit commented 3 years ago

Videos are different thing for Chromium and chrome. There is codec (or a mechanism, I am not sure) which is there in chrome and it's not there in chromium. WA uses that to buffer videos. without it WA can't show videos on chromium. There is no solution for that at the moment.

jasp402 commented 3 years ago

I have reviewed a bit about the need to use Chromium, but I think it is possible to use https://www.npmjs.com/package/chrome-launcher. in fact I did a test and it works fine, the only disadvantage is the case that the person does not have Chrome installed on their computer. However, it is possible to join both solutions, that is, if you do not have chrome, Chromium is installed...

advantage:

You may be wondering how to link PuppeteerJS with Chrome. and the truth is quite simple. with the connect () function it allows to connect the Google Chrome instance with Puppiteer and basically everything remains the same. It only requires the webSocketDebuggerUrl parameter which is obtained from the Chrome connection

const browser = await puppeteer.connect({browserWSEndpoint: webSocketDebuggerUrl, defaultViewport  : null});
page = await browser.pages();

I understand that this represents a big change. I have decided to rewrite the whole project piece by piece to understand it and create different solutions.