Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeout epic #25

Closed
viperdriver2000 opened this issue Sep 12, 2022 · 9 comments
Closed

timeout epic #25

viperdriver2000 opened this issue Sep 12, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@viperdriver2000
Copy link

hi
i got timeouts.

/usr/bin/docker run --rm -p 6080:6080 -p 5900:5900 -v /mnt/nfs/export/docker/free-games-claimer_jackblk/epic-games/data:/fgc/data --name free-games-claimer_jackblk-epic-games free-games-claimer-epic-games
userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36
Signed in.
Number of free games: 2
locator.innerText: Timeout 20000ms exceeded.
=========================== logs ===========================
waiting for selector "//button[@data-testid="purchase-cta-button"][not(contains(.,"Loading"))] >> nth=0"
============================================================
    at file:///fgc/epic-games.js:71:124 {
  name: 'TimeoutError'
}

any ideas about that?
thanks

@vogler
Copy link
Owner

vogler commented Sep 15, 2022

I have the same issue. Seems to be a race. When stepping through with PWDEBUG=1 node epic-games there is no problem.
Strange thing is that it finds the two elements to click on but then the click somehow makes it navigate to a 404 page.

@vogler vogler closed this as completed in cbe789b Sep 15, 2022
@vogler
Copy link
Owner

vogler commented Sep 15, 2022

Should be fixed for now, but not a great solution.
As the commit says, should wait for some element/attribute/event instead.
Maybe there's JS that has to attach event listeners first.

@vogler
Copy link
Owner

vogler commented Sep 16, 2022

Apparently it's not time-related after all. Even with networkidle and waitForTimeout(2000) it sometimes (but rarely) got into this situation.

@vogler vogler reopened this Sep 16, 2022
@viperdriver2000
Copy link
Author

thanks for your feedback.
im on commit cbe789b (HEAD -> main, origin/main, origin/HEAD)

but i get the same error.

userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36
Signed in.
Number of free games: 2
locator.innerText: Timeout 20000ms exceeded.
=========================== logs ===========================
waiting for selector "//button[@data-testid="purchase-cta-button"][not(contains(.,"Loading"))] >> nth=0"
============================================================
    at file:///fgc/epic-games.js:71:124 {
  name: 'TimeoutError'
}

vogler added a commit that referenced this issue Sep 22, 2022
@viperdriver2000
Copy link
Author

thanks for your change.
im on commit 1dc3b3d (HEAD -> main, origin/main, origin/HEAD)

get a new error:

userAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36
Signed in.
Number of free games: 2
Current free game: ARK: Survival Evolved
Already in library! Nothing to claim.
Current free game: Gloomhaven
Not in library yet! Click GET.
page.waitForSelector: Timeout 20000ms exceeded.
=========================== logs ===========================
waiting for selector "text=Thank you for buying" to be visible
============================================================
    at file:///fgc/epic-games.js:115:20 {
  name: 'TimeoutError'
}
Saved a screenshot of hcaptcha challenge to /fgc/data/screenshots/epic-games/2022-09-23 06.17.11.360.png
Got hcaptcha challenge. To avoid it, get a link from https://www.hcaptcha.com/accessibility

@vogler
Copy link
Owner

vogler commented Sep 23, 2022

Did you check if you got a hcaptcha challenge?
I think they got more aggressive. While testing a couple of times in a row it also showed me a captcha and I had to get a fresh IP to avoid it.

@viperdriver2000
Copy link
Author

okay i see there was a hcaptcha challenge.
okay i will check it next week again ^^

@vogler vogler added the bug Something isn't working label Sep 29, 2022
vogler added a commit that referenced this issue Sep 29, 2022
@vogler
Copy link
Owner

vogler commented Sep 29, 2022

Ok, with 69d771b I just had the case where the printed urlSlug was correct, but the click resulted in a 404. I'll change the code to just visit those links then instead of clicking.

@vogler
Copy link
Owner

vogler commented Sep 29, 2022

Should be fixed by edb90fe. Please reopen if you still encounter the issue after updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants