snobu / destreamer

Save Microsoft Stream videos for offline enjoyment.
MIT License
2.37k stars 438 forks source link

Chromium crashes on launch #32

Closed flaviuc closed 4 years ago

flaviuc commented 4 years ago

chromium crashing on Windows x64... tried to change puppeteer and chromium versions but no luck. what else can I do?

flaviuc commented 4 years ago

CHROMIIUM PS

snobu commented 4 years ago

Try changing this line in destreamer.ts and rebuild -

https://github.com/snobu/destreamer/blob/161585844f5ae8bf351611acca0d01fe13525056/destreamer.ts#L97

change to

    const page = await browser.newPage();

What Node version are you on (node --version)? Just tested on Windows with v13.11 and i can't reproduce it myself.

snobu commented 4 years ago

One more thing, you can specify your own Chromium (or Chrome) binary by passing it to the pupeteer constructor:

destreamer.ts

const browser = await puppeteer.launch(
    {executablePath: '/path/to/Chrome_or_Chromium'});

Here's an example for Windows paths: https://github.com/puppeteer/puppeteer/issues/4215

And here's where that is in our code - https://github.com/snobu/destreamer/blob/dev/destreamer.ts#L92

flaviuc commented 4 years ago

hi again I tried both... even with the "regular" chrome but somehow it still crashes the same way. even tried to hardcode the URL it goes to, but that's not it, it crashes even before... maybe I just need to find the right combination of puppeteer and Chromium that works (like in issue 4).

snobu commented 4 years ago

I wonder if antivirus software or something similar could prevent puppeteer connecting to the dev tools API in the browser.

flaviuc commented 4 years ago

good question I added the project folder, node.exe, powershell.exe and chrome.exe to exclusion list but still the same... could well be I guess, I disabled AV though completely and still the same.

flaviuc commented 4 years ago

ok, got a bit further... I added the startup args in launch.json, started the process from VS Code as debugger this time it got through the login phase but then crashed again, no breakpoint. Untitled picture

flaviuc commented 4 years ago

setting some breakpoints I believe it crashes in this line

await browser.waitForTarget(target => target.url().includes('microsoftstream.com/'), { timeout: 180000 });
flaviuc commented 4 years ago

also the initial crash is due to me starting PS as administrator... VSCode is not started as admin

snobu commented 4 years ago

Try it from non-elevated PowerShell or cmd.exe. Never tested from an elevated shell.

flaviuc commented 4 years ago

happy to report it works now from PS. From VSCode it still crashes I don't mind that. Thanks for the help!