SamuelScheit / puppeteer-stream

A Library for puppeteer to retrieve audio and/or video streams
MIT License
333 stars 105 forks source link

getStream is not work #69

Closed liyikun closed 1 year ago

liyikun commented 1 year ago

const { launch, getStream } = require("puppeteer-stream");
const fs = require("fs");

 const browser = await launch({
    ignoreHTTPSErrors: true,
    executablePath: '/Applications/Google Chrome 2.app/Contents/MacOS/Google Chrome',
    args: [
       "--no-sandbox",
       "--autoplay-policy=no-user-gesture-required",
       "--disable-web-security",
    ],
    defaultViewport: {
        width: 800,
        height: 1280,
    },
  });

  const page = await browser.newPage();

  page.on('console', msg => console.log('PAGE LOG:', msg.text()));

  await page.goto('xxxxx')

  console.log("recording");

  const stream = await getStream(page, { audio: true, video: true });

  console.log("recording2");

"recording2" do not print, because getStream method is block.

liyikun commented 1 year ago

Apple M1 Pro

liyikun commented 1 year ago

browser 101.0.4951.64

JijaProGamer commented 1 year ago

My problem resolved when I deleted all my args and ignoreHTTPSErrors. Can you try that and tell me if it works?

liyikun commented 1 year ago

My problem resolved when I deleted all my args and ignoreHTTPSErrors. Can you try that and tell me if it works?

it works, but i need there args.

liyikun commented 1 year ago

My problem resolved when I deleted all my args and ignoreHTTPSErrors. Can you try that and tell me if it works?

Is there anything else you can do?

liyikun commented 1 year ago

@Flam3rboy hi, Have you ever met

romain130492 commented 1 year ago

--disable-web-security when ON doesnt work with that package for some reason, any idea @Flam3rboy ?

paulnen commented 1 year ago

it seems like an executablePath is required to be able to record directly in webm

const { executablePath } = require('puppeteer'); const browser = await launch({ executablePath: executablePath() });

SamuelScheit commented 1 year ago

Could you try it with the latest puppeteer version, I've refactored a lot to improve performance and reliability.

npm i puppeeteer-stream@latest