epicgames-freegames-node icon indicating copy to clipboard operation
epicgames-freegames-node copied to clipboard

API purchase experienced an error

Open Snazzie opened this issue 2 years ago • 8 comments

Describe the bug

Failing to purchase. Screenshots or Logs

[2022-01-06 06:22:21.905 +0000] INFO : Purchasing Shadow of the Tomb Raider: Definitive Edition
[2022-01-06 06:22:24.322 +0000] WARN (HTTPError): Response code 400 (Bad Request)
HTTPError: Response code 400 (Bad Request)
at Request.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2022-01-06 06:22:24.323 +0000] WARN : API purchase experienced an error, trying puppeteer purchase

Additional context

Running latest in docker.

Snazzie avatar Jan 06 '22 06:01 Snazzie

This is just #164.

I'm kind of surprised to see it because I put in a dozen fixes for this recently. Can you set logLevel: debug and try again?

claabs avatar Jan 06 '22 14:01 claabs

Will do when the next round of free games come. I've redeemed them manually after not getting it to work.

Snazzie avatar Jan 06 '22 20:01 Snazzie

> [email protected] entrypoint-config /usr/app
> node dist/src/entrypoint-config.js

Setting timezone: Europe/London
Run on startup: true
Setting timezone: Europe/London
Run on startup: true
[2022-01-18 12:33:28.583 +0000] INFO : Started epicgames-freegames-node
COMMIT_SHA: "5989a60c848fa577223e9d7fe310df7cf9eeb567"
BRANCH: "master"
DISTRO: "alpine"
[2022-01-18 12:33:28.657 +0000] DEBUG: Performing version check

PROJECT_NAME: "epicgames-freegames-node"
BRANCH: "master"
COMMIT_SHA: "5989a60c848fa577223e9d7fe310df7cf9eeb567"
[2022-01-18 12:33:28.959 +0000] INFO : Checking free games for [email protected]
[2022-01-18 12:33:28.964 +0000] DEBUG: Refreshing login session
user: "[email protected]"
[2022-01-18 12:33:34.943 +0000] INFO : Successfully refreshed login
user: "[email protected]"
[2022-01-18 12:33:34.943 +0000] DEBUG: Getting global free games
user: "[email protected]"
[2022-01-18 12:33:35.625 +0000] DEBUG: Retrieved catalog data for 17 games
user: "[email protected]"
[2022-01-18 12:33:35.626 +0000] DEBUG: Found 1 unique free games in catalog
user: "[email protected]"
[2022-01-18 12:33:35.626 +0000] INFO : Available free games
user: "[email protected]"
availableGames: [
"Galactic Civilizations III"
]
[2022-01-18 12:33:35.626 +0000] DEBUG: Checking ownership on available games
user: "[email protected]"
[2022-01-18 12:33:35.626 +0000] DEBUG: Getting product ownership info
user: "[email protected]"
offerId: "5d63b78c08184c10933a47874117db8c"
namespace: "3c52fbac843d4375803187739db84801"
[2022-01-18 12:33:35.625 +0000] DEBUG: Retrieved catalog data for 17 games
user: "[email protected]"
[2022-01-18 12:33:35.626 +0000] DEBUG: Found 1 unique free games in catalog
user: "[email protected]"
[2022-01-18 12:33:35.626 +0000] INFO : Available free games
user: "[email protected]"
availableGames: [
"Galactic Civilizations III"
]
[2022-01-18 12:33:35.626 +0000] DEBUG: Checking ownership on available games
user: "[email protected]"
[2022-01-18 12:33:35.626 +0000] DEBUG: Getting product ownership info
user: "[email protected]"
offerId: "5d63b78c08184c10933a47874117db8c"
namespace: "3c52fbac843d4375803187739db84801"
[2022-01-18 12:33:36.092 +0000] INFO : Unpurchased free games
user: "[email protected]"
purchasableGames: [
"Galactic Civilizations III"
]
[2022-01-18 12:33:36.092 +0000] INFO : Purchasing Galactic Civilizations III
[2022-01-18 12:33:37.416 +0000] DEBUG: purchaseToken
user: "[email protected]"
purchaseToken: "REDACTED PURCHASE TOKEN"
[2022-01-18 12:33:37.416 +0000] DEBUG: purchaseToken
user: "[email protected]"
purchaseToken: "REDACTED PURCHASE TOKEN"
[2022-01-18 12:33:38.659 +0000] DEBUG: Error encountered during purchase

user: "[email protected]"
errorBody: {
"error": true,

"message": "We could not confirm your purchase at this time. Please try again later.",
"order": null,
"syncToken": "87fc861d-b911-4997-b5a3-6ae439db03db"
}
code: 400
[2022-01-18 12:33:38.659 +0000] WARN (HTTPError): Response code 400 (Bad Request)
HTTPError: Response code 400 (Bad Request)
at Request.<anonymous> (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2022-01-18 12:33:38.659 +0000] WARN : API purchase experienced an error, trying puppeteer purchase

[2022-01-18 12:33:38.662 +0000] DEBUG: Setting hCaptcha accessibility cookies
[2022-01-18 12:33:53.736 +0000] DEBUG: Killing new browser processes spawned
chromiumProcesses: []
[2022-01-18 12:33:53.736 +0000] WARN : browser launch did not work after 15000ms. Trying again.
attempts: 0
MAX_ATTEMPTS: 5
[2022-01-18 12:34:00.677 +0000] DEBUG: Error from hCaptcha get_cookie request, continuing without hCaptcha accessibility cookies

status: 401
errorBody: {
"status": "error"

}
[2022-01-18 12:34:00.834 +0000] DEBUG: Purchasing with puppeteer (short)
user: "[email protected]"
[2022-01-18 12:34:16.725 +0000] INFO : Loading purchase page
user: "[email protected]"
purchaseUrl: "https://www.epicgames.com/store/purchase?highlightColor=0078f2&offers=1-3c52fbac843d4375803187739db84801-5d63b78c08184c10933a47874117db8c&orderId&purchaseToken&showNavigation=true"
[2022-01-18 12:34:28.175 +0000] DEBUG: Clicking placeOrderButton
user: "[email protected]"
[2022-01-18 12:34:28.330 +0000] DEBUG: Clicking euRefundAgreeButton
user: "[email protected]"
[2022-01-18 12:34:28.487 +0000] DEBUG: Waiting for receipt
user: "[email protected]"
[2022-01-18 12:34:28.175 +0000] DEBUG: Clicking placeOrderButton
user: "[email protected]"
[2022-01-18 12:34:28.330 +0000] DEBUG: Clicking euRefundAgreeButton
user: "[email protected]"
[2022-01-18 12:34:28.487 +0000] DEBUG: Waiting for receipt
user: "[email protected]"
[2022-01-18 12:34:30.065 +0000] DEBUG: Captcha detected
user: "[email protected]"
[2022-01-18 12:34:30.530 +0000] INFO : Go to this URL and do something
user: "[email protected]"
url: "https://tasty-bobcat-23.loca.lt/?targetId=5A7C865B9361DAB732BDA17B0949C149"
[2022-01-18 12:34:30.530 +0000] WARN : No notifiers configured globally, or for the account. This log is all you'll get
url: "https://tasty-bobcat-23.loca.lt/?targetId=5A7C865B9361DAB732BDA17B0949C149"
accountEmail: "[email protected]"
reason: "PURCHASE"
[2022-01-18 12:34:30.065 +0000] DEBUG: Captcha detected
user: "[email protected]"
[2022-01-18 12:34:30.530 +0000] INFO : Go to this URL and do something
user: "[email protected]"
url: "https://tasty-bobcat-23.loca.lt/?targetId=5A7C865B9361DAB732BDA17B0949C149"
[2022-01-18 12:34:30.530 +0000] WARN : No notifiers configured globally, or for the account. This log is all you'll get
url: "https://tasty-bobcat-23.loca.lt/?targetId=5A7C865B9361DAB732BDA17B0949C149"
accountEmail: "[email protected]"
reason: "PURCHASE"

Snazzie avatar Jan 18 '22 12:01 Snazzie

From the logs, it just looks like you don't have any notifiers configured. Some example configs are listed here: https://github.com/claabs/epicgames-freegames-node#configjson-or-configjson5

claabs avatar Jan 18 '22 14:01 claabs

Is notifiers required? i left it because i dont need it. im hoping it will just claim it for me and thats it :P

Snazzie avatar Jan 18 '22 18:01 Snazzie

i think this is the culprit of why its failing?

[2022-01-18 12:34:00.677 +0000] DEBUG: Error from hCaptcha get_cookie request, continuing without hCaptcha accessibility cookies

status: 401
errorBody: {
"status": "error"

}

Snazzie avatar Jan 18 '22 18:01 Snazzie

then later it fails because it cant auto complete the captcha

Snazzie avatar Jan 18 '22 18:01 Snazzie

Auto captcha complete doesn't work currently (see #178). You'll need a notifier to be configured in order to solve the captcha yourself. These days, every free game purchase requires solving a captcha.

claabs avatar Jan 18 '22 22:01 claabs

No longer relevant in latest version

claabs avatar Feb 15 '24 01:02 claabs