SamuelScheit / puppeteer-stream

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

Timeout 30000ms exceeded with default example #93

Closed BlackYuzia closed 1 year ago

BlackYuzia commented 1 year ago

Hi there.

const file = createWriteStream("./test.webm");

async function test() {
    const browser = await launch({
        userDataDir: "./data-chrome",
        executablePath: normalize("node_modules\\puppeteer\\.local-chromium\\win64-1036745\\chrome-win\\chrome.exe"),
        //         defaultViewport: {
        //             width: 1920,
        //             height: 1080,
        //         },
    });

    const page = await browser.newPage();
    await page.goto("https://www.youtube.com/watch?v=dQw4w9WgXcQ");
    const stream = await getStream(page, { audio: true, video: true });
    console.log("recording");

    stream.pipe(file);
    setTimeout(async () => {
        await stream.destroy();
        file.close();
        console.log("finished");
    }, 1000 * 10);
}

test();

Try use this. I get open video but after 30 seconds I get error

TimeoutError: waiting for target failed: timeout 30000ms exceeded
478467337 commented 1 year ago

upgrade chrome,add '--headless=chrome'

SamuelScheit commented 1 year ago

@BlackYuzia were you able to resolve this issue by using --headless=chrome? If not, please provide more information about your environment and a screenshot of the puppeteer browser window.

BlackYuzia commented 1 year ago

Don't test yet, I will test and respond a bit later.

princefishthrower commented 5 months ago

Seems this issue has returned: https://github.com/SamuelScheit/puppeteer-stream/issues/110