snobu / destreamer

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

ERROR: Failed to launch browser process #215

Closed ShaleenAg closed 4 years ago

ShaleenAg commented 4 years ago

When I try to download using destreamer this is the output I get

 Username: myusername

[WARNING] .token_cache not found.

Launching headless Chrome to perform the OpenID Connect dance...

[ERROR] Error: Failed to launch the browser process!
/mnt/d/Downloads/Compressed/destreamer-master/destreamer-master/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (/mnt/d/Downloads/Compressed/destreamer-master/destreamer-master/node_modules/puppeteer/lib/Launcher.js:750:14)
    at Interface.helper.addEventListener (/mnt/d/Downloads/Compressed/destreamer-master/destreamer-master/node_modules/puppeteer/lib/Launcher.js:739:50)
    at Interface.emit (events.js:203:15)
    at Interface.close (readline.js:397:8)
    at Socket.onend (readline.js:173:10)
    at Socket.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19) 

I am running it on wsl in windows , I have checked the missing file is present

Screenshot_22

snobu commented 4 years ago

Looks like you're missing libnss3-dev. Try this:

sudo apt-get install libnss3-dev
ShaleenAg commented 4 years ago

Tried it but it didn't work . libnss3 was installed without any problems , here's the output

/destreamer.sh -u **user** -i https://web.microsoftstream.com/video/5adacbb0-3c52-45dc-9e46-c7a46b118df8
Username: ** user***

[WARNING] .token_cache not found.

Launching headless Chrome to perform the OpenID Connect dance...

[ERROR] Error: Failed to launch the browser process!
/mnt/d/Downloads/Compressed/destreamer-master/destreamer-master/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: error while loading shared libraries: libcups.so.2: cannot open shared object file: No such file or directory

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (/mnt/d/Downloads/Compressed/destreamer-master/destreamer-master/node_modules/puppeteer/lib/Launcher.js:750:14)
    at Interface.helper.addEventListener (/mnt/d/Downloads/Compressed/destreamer-master/destreamer-master/node_modules/puppeteer/lib/Launcher.js:739:50)
    at Interface.emit (events.js:203:15)
    at Interface.close (readline.js:397:8)
    at Socket.onend (readline.js:173:10)
    at Socket.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

it's asking for libcups or something, I have tried searching for it but couldn't figure out the package needed

lukaarma commented 4 years ago

This should be the right package to install sudo apt-get install libcups2 (source here)

I assumed you were using the latest ubuntu distro, let me know if that's not the case (not that matters much I think)

ShaleenAg commented 4 years ago

I solved that and there were some other packgaes missing too which I had to install but when i launch it from my wsl it opens the chrome window in wsl but it crashes every time when loading the Microsoft login page Is there anyway I could execute it in windows without using a VM?

lukaarma commented 4 years ago

You can install node and ffmpeg in windows and run it there without any problem

ShaleenAg commented 4 years ago

I tried running on windows but it threw this error

D:\Downloads\Compressed\destreamer-master\destreamer-master>destreamer.cmd -i https://web.microsoftstream.com/video/ab4ea723-85b9-4ad6-a337-801d16ad6dae?referrer=https:%2F%2Fteams.microsoft.com%2F_

[WARNING] .token_cache not found.

Launching headless Chrome to perform the OpenID Connect dance...

[ERROR] Error: Failed to launch the browser process! spawn D:\Downloads\Compressed\destreamer-master\destreamer-master\node_modules\puppeteer\.local-chromium\win64-722234\chrome-win\chrome.exe ENOENT

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (D:\Downloads\Compressed\destreamer-master\destreamer-master\node_modules\puppeteer\lib\Launcher.js:750:14)
    at ChildProcess.<anonymous> (D:\Downloads\Compressed\destreamer-master\destreamer-master\node_modules\puppeteer\lib\Launcher.js:741:65)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
ShaleenAg commented 4 years ago

I tried running on windows but it threw this error

D:\Downloads\Compressed\destreamer-master\destreamer-master>destreamer.cmd -i https://web.microsoftstream.com/video/ab4ea723-85b9-4ad6-a337-801d16ad6dae?referrer=https:%2F%2Fteams.microsoft.com%2F_

[WARNING] .token_cache not found.

Launching headless Chrome to perform the OpenID Connect dance...

[ERROR] Error: Failed to launch the browser process! spawn D:\Downloads\Compressed\destreamer-master\destreamer-master\node_modules\puppeteer\.local-chromium\win64-722234\chrome-win\chrome.exe ENOENT

TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (D:\Downloads\Compressed\destreamer-master\destreamer-master\node_modules\puppeteer\lib\Launcher.js:750:14)
    at ChildProcess.<anonymous> (D:\Downloads\Compressed\destreamer-master\destreamer-master\node_modules\puppeteer\lib\Launcher.js:741:65)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
snobu commented 4 years ago

ENOENT means No such file or directory. Try running npm install again after removing node_modules altogether and move destreamer-master to root of C drive so the overall path to Chromium becomes shorter. It's a Windows thing (255 chars in path max).

You can also do this:

 subst Y: C:\Example\File\Path\to\destreamer-master

Then switch to Y: and give it a go.

ShaleenAg commented 4 years ago

Thank You, running npm install after removing node_modules worked