epicgames-freebies-claimer: Error when claiming new mystery games
Outcome with error when claiming Shenmue III
Failed to claim Shenmue III (Error: Unable to acquire purchase token)
Specifications
epicgames-freebies-claimerVersion: v1.5.7- Platform / OS: Debian
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 16
- Comments: 32 (9 by maintainers)
Just did some debugging and I currently have a feeling that Epic blocks the access from node-epicgames-client, which is the underlying framework for this project.
When using this client to access
ue-launcher-website-prod.ol.epicgames.com, Epic always returnsError 500withWe are currently doing some updates to the site., which is actually not the case - if you directly visithttps://${ENDPOINT.PORTAL_ORIGIN}/purchase?showNavigation=true&namespace=${offer.namespace}&offers=${offer.id}with the same namespace and ID in any browser, the order page can be correctly shown. So Epic’s servers should be fine.I believe this requires some changes in the underlying node-epicgames-client to trick Epic. For those who are also interested in it, you can find where the
purchaseTokenis retrieved in lines 592 to 599 of this index.js file.https://github.com/Revadike/epicgames-freebies-claimer/releases/tag/V1.5.8
Huh, I think I found the problem why server responds with 500 on our claimer, but not the browser.
Here’s the actual curl to get
purchaseTokenfor Remnant: From the Ashes, taken from the browser:Here’s the curl in our claimer client (Authorization header is not needed):
Notice the diff? It’s the namespace lol.
Apparently the namespace in freeGamesPromotions API is not correct.
What I did:
offer.namespace = "663e521f2a444199be58152fd93fa66e"Now it will respond with 200, the purchase token will load correctly.
I haven’t tested fully to see if it can buy the game or not, because if I buy it, I will not have any account left to claim (lol). But I think this is the root cause, you can try it out yourself 😄
You mean this? https://github.com/luminoleon/epicgames-claimer/commit/83d2707f7552ac9a0907ba877f9de658a1fc5680
This project uses a whole different approach, sadly. It uses a whole internet browser and automate user-actions. It’s something I considered myself, but the approach I am currently (with just HTTP requests) using is way more lightweight and doesn’t depend on the user interface.
@jackblk was right. The free games API is returning the wrong namespace. I’ll soon release a workaround that grabs the correct namespace from another API result. That should fix it.
Tried to get the game by hand, and EGS site is going nuts, can’t even get the game manually, maybe this is the problem?
@zjbthomas I don’t know exactly, Remnant: From the Ashes has been handed out before. Today I picked up the game again by hand and was asked for confirmation. Perhaps you have something to do with this (if you have already taken the game before).
I have such an error
ReferenceError: url is not definedUPD: I fix it:D
const url = require('url');Exactly the same error as you got
Thanks @XEGARE for following up. I am now able to retrieve the
purchaseToken, but the issue is more than that.Just as a reference, my way to get the
purchaseTokenis:In the next step, a post request should be sent to the
order-previewpage (see functionpurchaseOrderPreview()in line 601 of index.js). This will throw an errorError: There was a problem processing your request. Please try again later.in line 628.I currently do not have enough spare Epic accounts to sniff the traffics for such step. Any help will be appreciated.
I tested and I see 2 possible errors:
It seems like the timeout error also happens on web 😄
Same error… Seems that the site is broken?
And it did not claim the games for me here. I will try to reduce the interval to see if it succeeds.EDIT: After hundreds of attempts, it still did not succeed. I manually claimed the game. And wait for a couple of hours. Then restart it. It still found an unclaimed freebie for me and failed with the same error.