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

Unhandled "This product is currently unavailable in your region" #46

Closed
SteveImmanuel opened this issue Jan 13, 2023 · 8 comments · Fixed by #48
Closed

Unhandled "This product is currently unavailable in your region" #46

SteveImmanuel opened this issue Jan 13, 2023 · 8 comments · Fixed by #48

Comments

@SteveImmanuel
Copy link

Ran on docker

Scenario:
There are multiple free games to be claimed, but some of them are unavailable in the user's region.

Expected behaviour:
Games that are unavailable are skipped and games that are available are claimed.

Existing behaviour:
Script exited after first attempt on unavailable game due to time out.

image

Logs:

$ docker run --rm -p 6080:6080 -v fgc:/fgc/data ghcr.io/vogler/free-games-claimer node epic-games
Xvfb display server created screen with resolution 1280x1280
VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080

2023-01-13 01:34:39.763 started checking epic-games
Signed in as ***********
Free games: [
  'https://store.epicgames.com/en-US/p/divine-knockout--standard',
  'https://store.epicgames.com/en-US/p/first-class-trouble',
  'https://store.epicgames.com/en-US/p/gamedec'
]
Current free game: Divine Knockout (DKO)
  Not in library yet! Click GET.
locator.click: Timeout 20000ms exceeded.
=========================== logs ===========================
  waiting for frameLocator('#webPurchaseContainer iframe')
  locator resolved to visible <iframe class="" src="/purchase?highlightColor=0078f2&of…></iframe>
waiting for frameLocator('#webPurchaseContainer iframe').locator('button:has-text("Place Order")')
============================================================
    at file:///fgc/epic-games.js:151:62 {
  name: 'TimeoutError'
}
@vogler
Copy link
Owner

vogler commented Jan 13, 2023

What region are you in?
The current version just checks https://store.epicgames.com/en-US/free-games since it relies on English text.
Where does it redirect you to if you visit https://store.epicgames.com/free-games and is there some way to get this in English?
Checking for US region and skipping unavailable games would work, but I think sometimes there are region-specific replacements that you'd miss then.

@vogler
Copy link
Owner

vogler commented Jan 13, 2023

A possible solution might be to get the currently available games for your region not relying on text but using CSS selectors and then do the rest in English.

@SteveImmanuel
Copy link
Author

My current region that is bound to my account is Indonesia. I think it is based on the location the first time we create an account.
Unfortunately, going to https://store.epicgames.com/free-games will just redirect me to https://store.epicgames.com/en-US/free-games. I think the en-US in the url is just based on the language settings and not related to the region.

Also, if I'm not mistaken, the region detecting system in epic is not based on IP at all but instead it is directly linked to the account because changing it requires contacting the customer service.

Related article:
https://www.epicgames.com/help/en-US/billing-support-c5719364845851/general-support-c5719348744091/how-do-i-change-the-country-on-my-epic-games-account-a5720356470555

@SteveImmanuel
Copy link
Author

Maybe the easiest solution for now is simply to skip games that are not available regionally.

@vogler
Copy link
Owner

vogler commented Jan 13, 2023

Yes, the region is bound to your account. I just wondered if there's some way to get an overview of what's available for your region. AFAIK the last time there was some replacement game for my region, I would get the correct list by visiting de-DE instead of en-US. Maybe this is a special case since Divine Knockout is free anyway and there is no replacement game for it. It's also strange that you can still click the 'get' button and only afterwards get this message.

@vogler
Copy link
Owner

vogler commented Jan 19, 2023

Can you check if #48 fixes it?
Can't test it since I don't have any game that's not available in my region.

Seems like I don't have images built for branches.
There are 3 options (for all of them you need to git checkout eg-unavailable-region):

  1. run locally without docker
  2. npm docker:build and run the new image
  3. keep your container (no --rm), terminal into it (bash at the end instead of node epic-games) and checkout the code there

Let me know if you need help.

@SteveImmanuel
Copy link
Author

Hi, I've commented in your PR.

@vogler
Copy link
Owner

vogler commented May 11, 2023

See 47be85f in #130.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants