vogler / free-games-claimer

Automatically claims free games on the Epic Games Store, Amazon Prime Gaming and GOG.
GNU Affero General Public License v3.0
2.46k stars 149 forks source link

Claim Free Asset Packs from the Unreal Engine Marketplace (Epic Games Store) #44

Open EthanC opened 1 year ago

EthanC commented 1 year ago

Each month, Epic releases a handful of asset packs for the Unreal Engine for free to all developers. These assets are made available on the Unreal Engine Marketplace, which seems to be a curated version of the Epic Games Store. There is a "Free for the Month" filter on the Unreal Engine Marketplace to find these product listings.

Here is the latest drop: Featured free Unreal Marketplace content—January 2023

foscoj commented 1 year ago

That feature would improve this already great tool even more :)

vogler commented 1 year ago

Please test it with node unrealengine.js. I just claimed the current assets successfully. There still may be some bugs though. Login code and options are the same as for epic-games.

EthanC commented 1 year ago

@vogler I'm not sure how to test it in Docker, could we get an environment variable for it? Maybe like EG_CLAIMUE=1?

EthanC commented 1 year ago

Update: Added the following line to docker-compose.yml...

    command: node unrealengine.js

Result is a TimeoutError on the first attempted claim, I also confirmed via browser that the package was not claimed.

Xvfb display server created screen with resolution 1280x720
VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080
2023-05-02 23:41:39.174 started checking unrealengine
Signed in as Sign In
[
  'Low Poly Viking World',
  'https://www.unrealengine.com/marketplace/en-US/product/low-poly-viking-world'
]
locator.click: Timeout 60000ms exceeded.
=========================== logs ===========================
waiting for locator('article.asset').first().locator('.btn .add')
  locator resolved to <i class="add">Add to Cart</i>
attempting click action
  waiting for element to be visible, enabled and stable
    element is not visible - waiting...
============================================================
    at file:///fgc/unrealengine.js:113:34 {
  name: 'TimeoutError'
}

image

vogler commented 1 year ago

You need to sign in first. Apparently the detection for it needs to be adjusted.

EthanC commented 1 year ago
Signed in as Sign In

Hacky solution - if the authenticated user's name appears to be Sign In, can the script attempt to reauthenticate?

vogler commented 1 year ago

'Sign In'/user detection works for me now and it claimed all assets successfully. However, the Thank you locator seems to be wrong and I missed to use RECORD=1 to check what it should be.

$ SHOW=1 node unrealengine.js
2023-06-02 00:08:48.182 started checking unrealengine
Signed in as ...
[
  'Low Poly Viking World',
  'https://www.unrealengine.com/marketplace/en-US/product/low-poly-viking-world'
]
  ↳ Already in cart
[
  'SICKA MANSION',
  'https://www.unrealengine.com/marketplace/en-US/product/sicka-mansion'
]
  ↳ Already in cart
[
  'Blink and Dash VFX',
  'https://www.unrealengine.com/marketplace/en-US/product/blink-and-dash-vfx'
]
  ↳ Already in cart
[
  'Advanced Photo Mode',
  'https://www.unrealengine.com/marketplace/en-US/product/advanced-photo-mode'
]
  ↳ Already in cart
[
  'Creating Portal To Another Reality',
  'https://www.unrealengine.com/marketplace/en-US/product/portal-another-reality'
]
  ↳ Already in cart
Price:  0 instead of €304.80
Click shopping cart
Click checkout
Click Place Order
page.waitForSelector: Timeout 20000ms exceeded.
=========================== logs ===========================
waiting for locator('text=Thank you') to be visible
============================================================
    at file:///Users/voglerr/dev/Web/free-games-claimer/unrealengine.js:164:18 {
  name: 'TimeoutError'
}
  Failed to claim! To avoid captchas try to get a new IP address.
Done

https://github.com/vogler/free-games-claimer/blob/f906bef2a82ba87b9748e8659c01fd9759360d91/unrealengine.js#L164

EthanC commented 1 year ago

I'm seeing a Price is not 0 exit with the latest Docker image. Minor note that this error is also not sent as a notification.

2023-06-01 22:35:38.486 started checking unrealengine
Signed in as Mxtive
[
  'Low Poly Viking World',
  'https://www.unrealengine.com/marketplace/en-US/product/low-poly-viking-world'
]
  ↳ Added to cart
[
  'SICKA MANSION',
  'https://www.unrealengine.com/marketplace/en-US/product/sicka-mansion'
]
  ↳ Added to cart
[
  'Blink and Dash VFX',
  'https://www.unrealengine.com/marketplace/en-US/product/blink-and-dash-vfx'
]
  ↳ Added to cart
[
  'Advanced Photo Mode',
  'https://www.unrealengine.com/marketplace/en-US/product/advanced-photo-mode'
]
  ↳ Added to cart
[
  'Creating Portal To Another Reality',
  'https://www.unrealengine.com/marketplace/en-US/product/portal-another-reality'
]
  ↳ Added to cart
Price:  undefined instead of 0
Price is not 0! Exit!

3a44680f-51aa-43ab-8779-568dbce774ca.webm

vogler commented 1 year ago

Interesting. Maybe it needs some time to set the value after adding all to the cart? What happens if you run it again such that you get ↳ Already in cart for all of them?

EthanC commented 1 year ago

Successfully claimed with the latest image! Looks like the text should be Thank you!?

2023-06-01 23:18:12.050 started checking unrealengine
Signed in as Mxtive
[
  'Low Poly Viking World',
  'https://www.unrealengine.com/marketplace/en-US/product/low-poly-viking-world'
]
  ↳ Already in cart
[
  'SICKA MANSION',
  'https://www.unrealengine.com/marketplace/en-US/product/sicka-mansion'
]
  ↳ Already in cart
[
  'Blink and Dash VFX',
  'https://www.unrealengine.com/marketplace/en-US/product/blink-and-dash-vfx'
]
  ↳ Already in cart
[
  'Advanced Photo Mode',
  'https://www.unrealengine.com/marketplace/en-US/product/advanced-photo-mode'
]
  ↳ Already in cart
[
  'Creating Portal To Another Reality',
  'https://www.unrealengine.com/marketplace/en-US/product/portal-another-reality'
]
  ↳ Already in cart
Price:  0 instead of $273.95
Click shopping cart
Click checkout
Click Place Order
page.waitForSelector: Timeout 60000ms exceeded.
=========================== logs ===========================
waiting for locator('text=Thank you') to be visible
============================================================
    at file:///fgc/unrealengine.js:167:18 {
  name: 'TimeoutError'
}
  Failed to claim! To avoid captchas try to get a new IP address.
Done

ad23d30d-15ca-4433-bcce-4a4ffd13f92f.webm

vogler commented 1 year ago

Thanks! Still need to check if 1 . the 2s wait solved the Price is not 0 error if all assets are first ↳ Added to cart,

  1. why the text Thank you is not found. For epic-games it had to be changed from Thank you for buying to Thanks for your order! in #128. Maybe the Thank you! text shown in your video is still in iframe and not page. Should step through it with PWDEBUG=1.
EthanC commented 1 year ago

New assets for June are now available. I see an error when attempting to run with RECORD=1 and PWDEBUG=1 in Docker.

Logs

Xvfb display server created screen with resolution 1280x720
VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080
2023-06-06 17:32:05.332 started checking unrealengine
node:internal/process/esm_loader:100
    internalBinding('errors').triggerUncaughtException(
                              ^
browserType.launchPersistentContext: 
╔═══════════════════════════════════════════════════╗
║ No chromium-based browser found on the system.    ║
║ Please run the following command to download one: ║
║                                                   ║
║     npx playwright install chromium               ║
║                                                   ║
║ <3 Playwright Team                                ║
╚═══════════════════════════════════════════════════╝
=========================== logs ===========================
<launching> /root/.cache/ms-playwright/firefox-1378/firefox/firefox -no-remote -wait-for-browser -foreground -profile /fgc/data/browser -juggler-pipe about:blank
<launched> pid=196
[pid=196][out] Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libpci missing (t=0.279721) [GFX1-]: glxtest: libpci missing
[pid=196][out] Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libpci missing (t=0.279721) |[1][GFX1-]: glxtest: libEGL missing (t=0.279775) [GFX1-]: glxtest: libEGL missing
[pid=196][out] 
[pid=196][out] Juggler listening to the pipe
============================================================
    at async file:///fgc/unrealengine.js:21:17
Node.js v19.9.0

I removed PWDEBUG=1 to bypass that error. Running again, I see the Price is not 0 error when all assets are added to cart.

Logs

Xvfb display server created screen with resolution 1280x720
VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080
2023-06-06 17:37:07.265 started checking unrealengine
Signed in as Mxtive
[
  'Stylized winter city environment',
  'https://www.unrealengine.com/marketplace/en-US/product/stylized-winter-city-environment'
]
  ↳ Added to cart
[
  'MEDA Furniture Pack',
  'https://www.unrealengine.com/marketplace/en-US/product/meda-furniture-pack'
]
  ↳ Added to cart
[
  'Vintage Room',
  'https://www.unrealengine.com/marketplace/en-US/product/vintage-room'
]
  ↳ Added to cart
[
  'Shanty Town Slums',
  'https://www.unrealengine.com/marketplace/en-US/product/shanty-town-slums'
]
  ↳ Added to cart
[
  'Interaction System Starter Pack',
  'https://www.unrealengine.com/marketplace/en-US/product/interaction-system-starter-pack'
]
  ↳ Added to cart
Price:  undefined instead of 0
Price is not 0! Exit! Please <a href="https://github.com/vogler/free-games-claimer/issues/44">report</a>.

Video

8b6b6217-0b8c-43e3-901c-6fce352c7958.webm

EthanC commented 1 year ago

New asset packs for July are now available. @vogler, incase you need to test.

EthanC commented 1 year ago

August asset packs are now available.

IOxee commented 11 months ago

Hello, I have tried to mount the application in my docker and what are the games of epic, prime and gog if I go but the unreal does not work, I tried to check the code on my own and I have not managed to make it work, am I the only one that happens?

vogler commented 11 months ago

@IOxee I haven't checked it for a while. Maybe it's broken since something changed. Paste your log, then we can check where it fails.

IOxee commented 11 months ago

I created a new container to test if by any chance it was something I had misconfigured yesterday, but it's still the same, I re-run the test. here you have my logs and the url of the version that says

Version = https://github.com/vogler/free-games-claimer/tree/4137bb5569221812ee065b3307e533774986722a

[+] Building 0.0s (0/0) docker:default [+] Running 1/1 ✔ Container fgcMain Created 0.1s Attaching to fgcMain fgcMain | Version: https://github.com/vogler/free-games-claimer/tree/4137bb5569221812ee065b3307e533774986722a fgcMain | Build: Thu, 26 Oct 2023 14:33:04 +0000 fgcMain | Xvfb display server created screen with resolution 1920x1080 fgcMain | VNC is running on port 5900 (no password!) fgcMain | noVNC (VNC via browser) is running on http://localhost:6080 fgcMain | fgcMain | 2023-10-28 11:47:05.089 started checking unrealengine fgcMain | Not signed in anymore. Please login in the browser or here in the terminal. fgcMain | Open http://localhost:6080 to login inside the docker container. fgcMain | Login timeout is 180 seconds! fgcMain | Using email and password from environment. fgcMain | --- Exception: fgcMain | page.click: Timeout 180000ms exceeded. fgcMain | =========================== logs =========================== fgcMain | waiting for locator('text=Sign in with Epic Games') fgcMain | ============================================================ fgcMain | at file:///fgc/unrealengine.js:62:18 { fgcMain | name: 'TimeoutError' fgcMain | } fgcMain exited with code 1

Elaborendum commented 11 months ago

I'm running this without Docker and choosing to show the browser because captchas, but despite my login from the main Epic Games store being recognized by the Unreal Engine site, this script doesn't recognize me and asks me to login. Signing out and relogging didn't seem to work either.

Logs don't really clear things up imagen

rolfwendt commented 10 months ago

Thanks! Still need to check if 1 . the 2s wait solved the Price is not 0 error if all assets are first ↳ Added to cart,

I'm running your fabulous script on a more low-end machine. For me, 2 seconds is too low. I've checked it in SHOW=1 mode and it took multiple seconds to load the cart thing, so I regularly got "Price: undefined instead of 0".

I've tested "await page.waitForTimeout(20000);" (increasing by factor 10) and that fixed the issue.

biast12 commented 9 months ago

@vogler i'm having the same issues as both Elaborendum and rolfwendt, any way you would be able to look into this when you get time? find this feature extremely useful i might say

Primajin commented 6 months ago

Currently it looks like it will only check for the free packs of the month - is there also an option to go through all free packs?

Screenshot 2024-03-11 104918

Screenshot 2024-03-11 104940

Primajin commented 6 months ago

I'm getting

  ↳ Added to cart
Price:  undefined instead of 0
Price is not 0! Exit!

now

BIDOUNI commented 4 months ago

Hey, anyone know how to install and use the unreal engine auto claimer in a linux vps please?

Cleboost commented 1 month ago

I'm getting

  ↳ Added to cart
Price:  undefined instead of 0
Price is not 0! Exit!

now

same error

yadalik commented 1 month ago
  1. Not using docker, on win10, with SHOW=1 set, it starts Nightly, at first getting infinite Cloudfare "checking are you human". In unrealengine.js changed original userAgent to this userAgent for firefox: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0 and it worked, then I changed it again to originals everything was working, then stopped working again on both userAgents when I done everything, anyways, not the case this time:

  2. I was trying to gather ALL free assets with URL_CLAIM = 'https://www.unrealengine.com/marketplace/en-US/free?count=100&sortBy=effectiveDate&sortDir=DESC, I've already claimed many of them manually before on the 1st page, and seeing this Free, it well recognized as already claimed, but something strange is happening here:

[
  'PID controller',
  'https://www.unrealengine.com/marketplace/en-US/product/pid-controller-01'
]
  ↳ Already claimed
[
  'ACE Unreal Engine Sample',
  'https://www.unrealengine.com/marketplace/en-US/product/ace-unreal-engine-sample'
]
--- Exception:
locator.click: Timeout 60000ms exceeded.
Call log:
  - waiting for locator('article.asset').nth(25).locator('.btn .add')

    at c:\prj\epic_autoinstaller\free-games-claimer\unrealengine.js:121:36 {
  name: 'TimeoutError'
}

(venv) c:\prj\epic_autoinstaller\free-games-claimer>

It does not have .btn.add class for ACE Unreal Engine inside details class: https://i.imgur.com/s3x17ZR.png, but have <div class="buylink-spacer"></div> near to it: https://i.imgur.com/8ClMrl3.png hope this would help.

  1. I'm not sure, but maybe deleting timeout here:
    await page.waitForTimeout(2000);
    const price = (await page.locator('.shopping-cart .total .price').innerText()).split(' ');

    and putting it below console.log(' ↳ Added to cart'); will significantly speed up things, for now I have to wait like 100s "already in cart". Maybe it would require adding timeout on shopping cart checkouts...

Primajin commented 2 weeks ago

Looks like the store will be "Fab" now 🤷🏻

https://www.unrealengine.com/en-US/blog/fab-content-marketplace-launches-in-october-publishing-portal-opens-today