Comments (11)
Hey @MustiDarsh thanks for reporting this! I've merged a fix to master, please pull and let me know if you bump into any other issue. Cheers!
from obooks.
Hi @jenni Thanks for the quick answer and fix. The above mentioned problem is (I think) fixed.
I am now receiving a timeout error:
:::::::: ::: ::::::::: :::::::: :::::::: ::: ::: ::::::::
:+: :+: :+ :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#+ +:+ +#++:++#+ +#+ +:+ +#+ +:+ +#++:++ +#++:++#++
+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#
######## ######### ######## ######## ### ### ########
+:++:++:++:+ loging in... might take a while +:++:++:++:+
(node:90630) UnhandledPromiseRejectionWarning: TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
at /Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/LifecycleWatcher.js:142:21
-- ASYNC --
at Frame.<anonymous> (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/helper.js:111:15)
at Page.waitForNavigation (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/Page.js:694:49)
at Page.<anonymous> (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/helper.js:112:23)
at GoogleAuthentication.login (/Users/MustiDarsh/Desktop/tmp/obooks/lib/authentication.js:94:20)
at async GoogleAuthentication.authenticate (/Users/MustiDarsh/Desktop/tmp/obooks/lib/authentication.js:51:29)
at async main (/Users/MustiDarsh/Desktop/tmp/obooks/cli.js:64:18)
(node:90630) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:90630) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Do you have any tips/advise on how to fix this error?
Note: I tried signing in using an account connected to Google and not using a gmail account.
from obooks.
@MustiDarsh it should work with accounts connected to google. It seems it's failing during google authentication - are you passing your gmail password in the -p flag?
You can always change this line: const browser = await puppeteer.launch({ headless: true })
to const browser = await puppeteer.launch({ headless: false })
, then run the command and see in the browser exactly where it's failing, then get back here with the issue or even screenshot and I'll try to fix it.
from obooks.
@jenni changing the line to const browser = await puppeteer.launch({ headless: false })
Yes, I am using my gmail password in combination with the -p flag.
results in the follow:
:::::::: ::: ::::::::: :::::::: :::::::: ::: ::: ::::::::
:+: :+: :+ :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#+ +:+ +#++:++#+ +#+ +:+ +#+ +:+ +#++:++ +#++:++#++
+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#
######## ######### ######## ######## ### ### ########
(node:70669) UnhandledPromiseRejectionWarning: Error: Protocol error (Page.navigate): Target closed.
at /Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/Connection.js:183:56
at new Promise (<anonymous>)
at CDPSession.send (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/Connection.js:182:12)
at navigate (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/FrameManager.js:118:39)
at FrameManager.navigateFrame (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/FrameManager.js:95:7)
at Frame.goto (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/FrameManager.js:406:37)
at Frame.<anonymous> (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/helper.js:112:23)
at Page.goto (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/Page.js:674:49)
at Page.<anonymous> (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/helper.js:112:23)
at GoogleAuthentication.goToLoginPage (/Users/MustiDarsh/Desktop/tmp/obooks/lib/authentication.js:101:20)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async GoogleAuthentication.authenticate (/Users/MustiDarsh/Desktop/tmp/obooks/lib/authentication.js:50:27)
at async main (/Users/MustiDarsh/Desktop/tmp/obooks/cli.js:64:18)
(node:70669) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:70669) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
MustiDarsh@MacBook-Pro obooks %
What happens is: I see a Chromium window opening and just a few seconds later it closes abruptly.
Maybe worth mentioning is that I am using a Mac.
from obooks.
@MustiDarsh this is a different error from the previous you mentioned and seems to be related to puppeteer/puppeteer#1947 , are you getting it often or did you just try once?
from obooks.
@jenni it seems like it is related to the post issue attached. However, I am unable to find any .close()
statements in your code. This suggests that I shouldn't expect the browser to ever close, but correct me if I am wrong.
from obooks.
@jenni I have tried it multiple times throughout the weekend, but unfortunately I still receive the error. Any ideas for a quick workaround or fix?
from obooks.
@MustiDarsh I'm not able to reproduce the issue. I'm using node v12.10.0
. Maybe you can update the package.json file and change "puppeteer": "^2.1.1",
run npm update
and try again?
from obooks.
@jenni I believe the problem doesn't occur with the specified versions. I will test this out and get back to you.
from obooks.
@MustiDarsh I'm working on Dockerising the project to get rid of versioning issues, meanwhile I've deactivated the option to log in in favor of a -c <cookie>
flag. This cookie can be grabbed from the Request Headers once logged in to OReilly. Hope it helps!
from obooks.
@jenni I have been testing it for a couple of weeks now. It is working perfectly with specified version.
Also, I find it a good idea dockerising the project. Let me know if I can help out.
from obooks.
Related Issues (18)
- Cover image missing from the books
- Compilation instructions and clarification on abilities? HOT 3
- No cookie ID present when logged in with a library card HOT 4
- Cookie format example HOT 9
- Handle O'Reilly 500 error while downloading chapters HOT 2
- Prevent image download if already exists
- Allow downloading several books at once
- Create cache for chapters
- "Invalid Character" Error when trying to download a book
- Trying to make this work, but I'm not understanding what I'm doing wrong HOT 7
- it only download images HOT 4
- Cover is not properly saved HOT 1
- Improve downloading times
- Not downloading book, images only. HOT 3
- Issues with the generated EPUB file (duplicate ch titles & toc, no cover img & css, toc anchor links not working)
- docker: Error response from daemon:
- broken generated epub file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obooks.