evmer / perlego-downloader

Download books from Perlego.com in PDF format
MIT License
106 stars 52 forks source link

'Browser closed unexpectedly' error #9

Open lilfmdude opened 1 year ago

lilfmdude commented 1 year ago

I have downloaded the new script but I'm still getting errors also the book id I'm trying is 1323963 maybe it has something to do with it? I do not know hope this helps you. image

evmer commented 1 year ago

Hello, same issue of #8

Did you follow these troubleshoot guidelines?

lilfmdude commented 1 year ago

yes i just double checked book id and the auth is correct i even pasted it again just incase same error

evmer commented 1 year ago

@lilfmdude the issue is not related to the book id or auth params, but to a misconfiguration of puppeeter/chrome driver dependences on Windows OS. Please follow these instructions:

image
lilfmdude commented 1 year ago

can you give me a detail instructions on how to add it to my system path? or do i just added with the same perlego downloader?

evmer commented 1 year ago

can you give me a detail instructions on how to add it to my system path? or do i just added with the same perlego downloader?

Download the latest version of chromedriver.exe here and place it in C:/Windows.

lilfmdude commented 1 year ago

did exactly as you said still getting same error

evmer commented 1 year ago

did exactly as you said still getting same error

You can try to follow this answer on stackoverflow and debug pyppeteer by yourself. Pop up the terminal, run python to open the command-line interpreter and then:

>>> from pyppeteer.launcher import Launcher
>>> ' '.join(Launcher().cmd)

Copy the result, exit from the python interpreter with exit(), paste the command in the terminal and run it. You should see the error that prevents pyppeeter from launching properly (maybe some missing dependences).

lilfmdude commented 1 year ago

this is what i get when pressing enter after inputting that command image

evmer commented 1 year ago

@lilfmdude copy-paste the commands without the >>>

lilfmdude commented 1 year ago

image this is what i get

evmer commented 1 year ago

@lilfmdude

Copy the result, exit from the python interpreter with exit(), paste the command in the terminal and run it. You should see the error that prevents pyppeeter from launching properly (maybe some missing dependences).

lilfmdude commented 1 year ago

like this? image

evmer commented 1 year ago

@lilfmdude No...you're not following the instructions. Please read carefully what I wrote and try again.

lilfmdude commented 1 year ago

sorry, when you say terminal do you mean on the visual terminal? and if so if not i have no idea image

lilfmdude commented 1 year ago

hey so i got it to work i just installed a vm workstation slapped linux on it and it just worked first try thanks man! i guess its just windows side its just not working i don't know

Noiade commented 1 year ago

sorry, when you say terminal do you mean on the visual terminal? and if so if not i have no idea image

Same for me. Reinstalled chromium several times. Put chromedriver to C:\WINDOWS. Chrome and pypeeter work perfectly. But the script does not:

C:\Users\forsite\Documents\perlego-downloader-main>C:\Users\forsite\AppData\Local\pyppeteer\pyppeteer\local-chromium\588429\chrome-win32\chrome.exe --disable-background-networking --disable-background-timer-throttling --disable-breakpad --disable-browser-side-navigation --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=site-per-process --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --metrics-recording-only --no-first-run --safebrowsing-disable-auto-update --enable-automation --password-store=basic --use-mock-keychain --headless --hide-scrollbars --mute-audio --disable-gpu about:blank --remote-debugging-port=51505 --user-data-dir=C:\Users\forsite\AppData\Local\pyppeteer\pyppeteer\.dev_profile\tmpjor6j0j5 C:\Users\forsite\Documents\perlego-downloader-main>

Still:

Traceback (most recent call last): File "C:\Users\forsite\Documents\perlego-downloader-main\downloader.py", line 244, in asyncio.run(html2pdf()) File "C:\Python310\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "C:\Users\forsite\Documents\perlego-downloader-main\downloader.py", line 165, in html2pdf browser = await launch(options={ File "C:\Python310\lib\site-packages\pyppeteer\launcher.py", line 307, in launch return await Launcher(options, **kwargs).launch() File "C:\Python310\lib\site-packages\pyppeteer\launcher.py", line 168, in launch self.browserWSEndpoint = get_ws_endpoint(self.url) File "C:\Python310\lib\site-packages\pyppeteer\launcher.py", line 227, in get_ws_endpoint raise BrowserError('Browser closed unexpectedly:\n') pyppeteer.errors.BrowserError: Browser closed unexpectedly:

I can send EVMER my downloader file (with BOOK and AUTH inserted) so as you could troubleshoot and/or simply download the book for me.

Noiade commented 1 year ago

did exactly as you said still getting same error

You can try to follow this answer on stackoverflow and debug pyppeteer by yourself. Pop up the terminal, run python to open the command-line interpreter and then:

>>> from pyppeteer.launcher import Launcher
>>> ' '.join(Launcher().cmd)

Copy the result, exit from the python interpreter with exit(), paste the command in the terminal and run it. You should see the error that prevents pyppeeter from launching properly (maybe some missing dependences).

Hello there! This solution helped me to troubleshoot under WSL/ubuntu and let pyppeteer work. So I managed to download the book finally - everything worked well.

Thanks a lot

cotagxrdhy commented 1 year ago

Hi,I'm having the same problem, has anyone solved the problem on Windows ?

I followed the instructions to troubleshoot everything, but it still doesn't work

josema2242 commented 1 year ago

help me please I tried in ubuntu but it gave me an error

enDanac33 commented 1 year ago

I get this error

o@o-B250M-DS3H:~/Escritorio$ python3 downloader.py download error: Connection timed out download error: Connection timed out download error: Connection timed out download error: Connection timed out download error: Connection timed out download error: Connection timed out download error: Connection timed out

pandamoon21 commented 1 year ago

I get this error

o@o-B250M-DS3H:~/Escritorio$ python3 downloader.py download error: Connection timed out download error: Connection timed out download error: Connection timed out download error: Connection timed out download error: Connection timed out download error: Connection timed out download error: Connection timed out

I got this error too, but after I use an account with an active subscription. It's starting to download.

Moanrisy commented 1 year ago

I got this bug too. Already reinstall chrome, put chromedriver on env PATH C:/Windows. None of this working. Now I will try WSL ubuntu.

Moanrisy commented 1 year ago

image

And I still got the error :'(

Moanrisy commented 1 year ago

Finally it work after reading this https://stackoverflow.com/a/71935536/10486986

AlloryDante commented 1 year ago

Solved on windows by installing official chrome and pointing Pupeteer to use it like this

            'headless': True,
            'autoClose': False,
            'executablePath': 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',

So modify line 171.

evmer commented 1 year ago

Thank you @cezarlacatus ! 🎉 Seems you have fixed one of the most frequent bugs here. I'm going to add your suggestion to the README.