-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
WARN HTTPError/42: Response code 400 (Bad Request) #195
Comments
Epic recently added captchas to the checkout, so the API-based checkout fails. It's designed to fallback to a Puppeteer (browser automation) based checkout. I'd recommend pulling the latest image and running again. If you still get |
Hi and thanks for the prompt response. I tried the latest image and the debian image, both failed :( Here's the log from debian version [2021-12-17 08:46:39.275 -0300] INFO (49 on 788ca9a0b0bd): Purchasing Shenmue III - Standard Edition |
If you've got time, could you set the log level to |
Ok here you go
Setting timezone: America/Sao_Paulo "sha256Hash": "xxx" "sha256Hash": "803d00fd80aef2cbb0b998ba27b761143d228195b86cc8af55e73002f18a1678" } "offerId": "1ad9b7fca007477ca454d2048d019d2f", ], [2021-12-17 14:43:05.261 -0300] DEBUG (38 on 788ca9a0b0bd): Setting hCaptcha accessibility cookies [2021-12-17 14:43:05.261 -0300] DEBUG (38 on 788ca9a0b0bd): Setting hCaptcha accessibility cookies |
I can tell by the purchase request that this isn't using the latest image. Use |
I'm running on unraid, maybe this isn't updated? but the repo is from https://hub.docker.com/r/charlocharlie/epicgames-freegames/ |
I also use Unraid. Just click "force update" and it will guarantee the latest. |
[2021-12-18 11:25:24.753 +0800] WARN (HTTPError/40 on 1186bc3a6dad): Response code 400 (Bad Request) |
I really am stumped here. All of these logs posted are just |
In regards to this. I've looked up the mentioned error and it might be related to a User-agent setting. I couldn't find reference to a user-agent setting in the project so maybe that might need to get added.. I'm sure the epic games client uses a special user-agent string when making api calls or web requests. |
The 400 error started showing when the purchase captcha was re-introduced. I just tried swapping the user-agent for the one they use and it changed nothing. Ultimately, epicgames-client is using device auth, and an older purchase call. I assume it has some kind of exclusion on Epic's side that makes it not require a captcha. I've considered switching to that method, but epicgames-freebies-claimer already does that. The goal with this project was to have an automation method that is not dependent on holes in Epic's bot prevention so I don't have to partake in an arms race with them. This project uses browser automation as a fallback for the API calls. I'm leaving the API method in place just in case the free games revert to not requiring captchas after this holiday event. |
So I actually just encountered this on my server. I was able to get past it by just restarting the container. I understand now that the process is just hanging with these logs being the last thing shown. I believe this is the same issue as #164. I just pushed an update in hopes that a recent puppeteer bugfix can resolve this. |
Usually I can restart the container and solve a new captcha for the purchase to go through, but the latest update seems to leave it hanging. Edit: Searched around a little more. Could be related to an Epic Store/server issue. Some complaints where people have been unable to redeem today's game.
|
Epic started returning undefined offers in the response. I pushed a fix to filter them out: 5de6791 |
I assume the undefined offers is what is causing the below?
I updated the container and tried again, it falls back to the puppeteer method, I fill out the captcha and then I land with an error on the page. If I click the puchare URL in the docker logs I can purchase it through the website as expected. I will try and get you logs tomorrow. As always, thanks for all the work man :) Edit:: Christ I hate github markup.. |
This issue has become a mess of like 10 different issues, with everyone seeing the same red herring The rest of the issues here seem to be one of:
A couple conclusions I've come to:
|
Sorry about that, I wasn't sure which was the lesser evil here.. After you wrote the above, I noticed my previous stack trace showed a DNS issue, which is in addition to the DNS issue I was seeing caused by my PiHole. So that's fun (and I'm bad at typescript :( ). I'll run down the error I'm seeing and look at opening a new issue if justified. If we expect the API purchase model is consistently broken now due to the Captcha, is there a benefit to continuing to include it? It would seem like there isn't. Combined with removing the Alpine image, it would solve for most of your problems, so makes sense to me. |
I'm currently going down the rabbit hole of removing Alpine. Currently, the issue is finding a Linux distro that supports:
Looks like the only one is Fedora, which makes things...interesting. |
I'm surprised Debian doesn't. I can see they've got an ARM64v8 image, but only Chromium90 :| And Christ that's a rabbit hole with puppeteer as well. The requirement for 96/97 being just for good security practice? If the OS change turns out to be too much pain, another option may be to target firefox nightly binaries instead (though that's its own circle of hell I'm sure). |
Using a latest Chrome/Chromium is just to ensure compatibility with a modern version of puppeteer. |
I published a Fedora version to the Unfortunately, it's using Chromium 95 for some reason despite 96 being released for a while. Not sure what's happening there, I'll have to take a look later. |
Will do when I get home in 2-3 hours. EDIT:: I've got it started, and it's seemingly working as intended. Unfortuantely there are currently no free games, so I can't tell you how it's going. Will update after the next drop when I wake up. |
I was able to figure out getting Chromium 96 running on Fedora. Check it out on the OpenSUSE didn't turn out well, since installing Chromium made the image 800MB larger. It doesn't have the chromium-headless profile that Fedora has. |
So I was able to text on x86-64, and it worked perfectly. The pull size was reasonable and everything was fast. I can't test this I'm sorry. I don't have an arm64 capable Pi, mine's 32bit :( |
I just got the puppeteer launch freeze on the dev tag. So unfortunately, it doesn't seem to fix the issue. Edit: some searching reveals some launch freezes are solved with --no-gpu. I can try that later. |
Current status on the In its current state, it doesn't seem to offer much value over I did add a working fix for the hang when launching a browser: #164 (comment) Since most things have been addressed now, I'll close this for now. Feel free to open another issue if something new pops up. |
Hi, I'm running in unraid, checked for latest docker version
yesterday worked fine, today I got this error. clues?
Thanks for the support!
[2021-12-16 21:46:25.166 -0300] INFO (42 on 86af86cfbfce): Unpurchased free games
user: "edited"
purchasableGames: [
"Shenmue III - Standard Edition"
]
[2021-12-16 21:46:25.166 -0300] INFO (42 on 86af86cfbfce): Purchasing Shenmue III - Standard Edition
[2021-12-16 21:46:28.581 -0300] WARN (HTTPError/42 on 86af86cfbfce): Response code 400 (Bad Request)
HTTPError: Response code 400 (Bad Request)
at Request. (/usr/app/node_modules/got/dist/source/as-promise/index.js:117:42)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2021-12-16 21:46:28.583 -0300] WARN (42 on 86af86cfbfce): API purchase experienced an error, trying puppeteer purchase
The text was updated successfully, but these errors were encountered: