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.6k stars 157 forks source link

Amazon Prime Gaming in game content claims fail #208

Closed KairuByte closed 11 months ago

KairuByte commented 1 year ago

It appears that the in game content claims have all started using the "multi week" claims, where you need to click not only into the games page, but also "claim" on the specific reward you want in order to actually reach the claiming page. If you watch the bot work, you'll see what I mean because it stalls for a long while waiting for the content it expects.

yoshimo commented 1 year ago

The new sub pages create errors like


Current DLC: Shadow Fight 3 - Legendary Keys
[AggregateError: All promises were rejected] {
  [errors]: [
    page.click: Timeout 60000ms exceeded.
    =========================== logs ===========================
    waiting for locator('button:has-text("Get in-game content")')
    ============================================================
        at file:///fgc/prime-gaming.js:347:33 {
      name: 'TimeoutError'
    },
    page.click: Timeout 60000ms exceeded.
    =========================== logs ===========================
    waiting for locator('button:has-text("Claim your gift")')
    ============================================================
        at file:///fgc/prime-gaming.js:347:87 {
      name: 'TimeoutError'
    },
    page.click: Timeout 60000ms exceeded.
    =========================== logs ===========================
    waiting for locator('button:has-text("Claim now")')
    ============================================================
        at file:///fgc/prime-gaming.js:347:137 {
      name: 'TimeoutError'
    }
  ]
}
Current DLC: The Crew Motorfest - Freedom Bundle
[AggregateError: All promises were rejected] {
  [errors]: [
    page.click: Timeout 60000ms exceeded.
    =========================== logs ===========================
    waiting for locator('button:has-text("Get in-game content")')
    ============================================================
        at file:///fgc/prime-gaming.js:347:33 {
      name: 'TimeoutError'
    },
    page.click: Timeout 60000ms exceeded.
    =========================== logs ===========================
    waiting for locator('button:has-text("Claim your gift")')
    ============================================================
        at file:///fgc/prime-gaming.js:347:87 {
      name: 'TimeoutError'
    },
    page.click: Timeout 60000ms exceeded.
    =========================== logs ===========================
    waiting for locator('button:has-text("Claim now")')
    ============================================================
        at file:///fgc/prime-gaming.js:347:137 {
      name: 'TimeoutError'
    }
  ]
}
Primajin commented 1 year ago

Yeah it looks for a button called "Claim now" - however the button is just called "Claim" now and thus it fails.

Mrgaton commented 11 months ago

[AggregateError: All promises were rejected] {

page.click: Timeout 60000ms exceeded.
Call log:
  - waiting for locator('button:has-text("Get in-game content")')

    at free-games-claimer\prime-gaming.js:352:33,
page.click: Timeout 60000ms exceeded.
Call log:
  - waiting for locator('button:has-text("Claim your gift")')

    at free-games-claimer\prime-gaming.js:352:87,
page.click: Timeout 60000ms exceeded.
Call log:
  - waiting for locator('button:has-text("Claim now")')

    at free-games-claimer\prime-gaming.js:352:137

] } [AggregateError: All promises were rejected] {

page.click: Timeout 60000ms exceeded.
Call log:
  - waiting for locator('button:has-text("Get in-game content")')

    at free-games-claimer\prime-gaming.js:352:33,
page.click: Timeout 60000ms exceeded.
Call log:
  - waiting for locator('button:has-text("Claim your gift")')

    at free-games-claimer\prime-gaming.js:352:87,
page.click: Timeout 60000ms exceeded.
Call log:
  - waiting for locator('button:has-text("Claim now")')

    at free-games-claimer\prime-gaming.js:352:137

] }

same :C

Mrgaton commented 11 months ago

image Also it doesnt claim this things

KairuByte commented 11 months ago

I'm seeing the same issue after updating to latest code. I confirmed prime-gaming.js has the two changes listed in the PR, but the bot still sits on the pre-claim page.

Edit: When the bot reaches this page, it freezes image

If you manually click "Claim" the bot continues. Otherwise it will time out and move on without claiming the item.

Edit edit: I describe this as "pre claim" because it is also the interface used when multiple claims are available for the same game. This isnt the page where the actual claiming happen, it is simply a list (sometimes of 1) of current offers for the game.

Edit edit edit: Also, as @Mrgaton mentioned, there is yet another button labelled as Get in-game content that seems to be having trouble. Another example is below: image

Primajin commented 11 months ago

Hmm even with the newest image it still looks for "Claim Now" not "Claim" 🤔

[AggregateError: All promises were rejected] {
  [errors]: [
    page.click: Timeout 15000ms exceeded.
    =========================== logs ===========================
    waiting for locator('button:has-text("Get in-game content")')
    ============================================================
        at /fgc/prime-gaming.js:352:33 {
      name: 'TimeoutError'
    },
    page.click: Timeout 15000ms exceeded.
    =========================== logs ===========================
    waiting for locator('button:has-text("Claim your gift")')
    ============================================================
        at /fgc/prime-gaming.js:352:87 {
      name: 'TimeoutError'
    },
    page.click: Timeout 15000ms exceeded.
    =========================== logs ===========================
    waiting for locator('button:has-text("Claim now")')
    ============================================================
        at /fgc/prime-gaming.js:352:137 {
      name: 'TimeoutError'
    }
  ]
}

Could it be that a new one was never published?

Screenshot 2023-12-22 155916

Primajin commented 11 months ago

OK I think I found the issues:

The latest image is only published under :main not under :latest.

Screenshot 2023-12-22 161837

This works much better and it recognizes when I don't have an account linked:

Screenshot 2023-12-22 161910

However eventually it still fails on a couple of titles with one of two errors:

Screenshot 2023-12-22 161820 Screenshot 2023-12-22 162428

This is because our friends at Amazon sometimes use a button and sometimes use an anchor link in the HTML:

Screenshot 2023-12-22 162726 Screenshot 2023-12-22 162604

So I guess we need to make the script versatile enough to check for either a button or a link with the given text - or instead look for the css class .tw-button

Mrgaton commented 11 months ago

image yes still not claiming it

sealldeveloper commented 11 months ago

On latest of the main branch and also experiencing the issue:

Printed output:

prime-gaming (***):
- Call of Duty: Warzone and Modern Warfare 2 - Hip Hop Hutch (undefined)
- League of Legends - Prime Gaming Capsule (undefined)
- New World - Ronin's Shadow Cache (undefined)
- Hearthstone - Standard Card Pack (3) (undefined)
- Diablo IV - Death's Burden Bundle Mount (undefined)
- Apex Legends - AR Pack Bundle (undefined)
- Monster Hunter Now - Wander Droplet and Potion (undefined)
- EA SPORTS FC 24 - Prime Gaming Pack #3 (undefined)
- Overwatch 2 - 5+ Tier Skips (undefined)
- Champions Ascension - Monster Part & 500 Essence (undefined)
- Paladins - Tomb Keeper Tiberius Skin (undefined)
- Dead Island 2 - From Dusk Ryan (undefined)
- Call of Duty: Mobile - Ruin - Goblin King Epic Operator Skin (undefined)
- Legends of Runeterra - Rare Prismatic Chest + Epic Wildcard (undefined)
- Battlefield 2042 - Rising Waters Weapon Skin and 1 Tier Skip (undefined)
- World of Tanks - Threestyler Package (undefined)
- Naraka: Bladepoint - Fascinated Avatar (undefined)
- Blade & Soul - Radiant Treasures Bundle – Prime Gaming (undefined)
- Cyberpunk 2077: Phantom Liberty - Amstaff (undefined)
- Aion - Daevanion Skill Bundle (undefined)
- Big Farm: Mobile Harvest - Profile Picture (undefined)
- Aion Classic - Black Gold Medal Bundle (undefined)

Logs:

Current DLC: League of Legends - Prime Gaming Capsule

page.inputValue: Timeout 60000ms exceeded.

Call log:
  - waiting for locator('input[type="text"]')
    at /fgc/prime-gaming.js:370:35
vogler commented 11 months ago

The latest image is only published under :main not under :latest.

Probably due to #229. However, the code looks like it should publish main as latest: https://github.com/vogler/free-games-claimer/blob/9f97805517041e60dddd90274c02834165ae6a1f/.github/workflows/docker.yml#L32-L36

Don't use latest since it has no meaning, just use --pull=always.

vogler commented 11 months ago

So I guess we need to make the script versatile enough to check for either a button or a link with the given text - or instead look for the css class .tw-button

Why not span:has-text() instead of the css class?

sealldeveloper commented 11 months ago

Further addition: Non-LOL has this error for all other titles. Ubuntu 20 btw.

Primajin commented 11 months ago

OK I tested it again and now it should work with #274 . I changed the selector to account for both types of buttons and in case there are more than one account link buttons, it will take the first one.

Fixes: Screenshot 2023-12-23 112602

Fixes: Screenshot 2023-12-23 112249

Screenshot 2023-12-23 115421

vogler commented 11 months ago

Can check/merge after lunch.

Primajin commented 11 months ago

So I guess we need to make the script versatile enough to check for either a button or a link with the given text - or instead look for the css class .tw-button

Why not span:has-text() instead of the css class?

Yeah I guess that could also work

sealldeveloper commented 11 months ago

Working well, small issue I'm noticing is that after the claim this timeout can linger instead of detecting the successful claim:

page.inputValue: Timeout 60000ms exceeded.
Call log:
  - waiting for locator('input[type="text"]')

    at /fgc/prime-gaming.js:370:35
vogler commented 11 months ago

@sealldeveloper I ignore the timeout now. However, it would be better to add a case for this. For which item does this happen and what is there instead of a code or account linking?

sealldeveloper commented 11 months ago

@vogler This has happened with:

The result is it properly being claimed but the output is just the error from timeout then it moves to the next one after waiting the timeout.

I've also noticed with EA accounts (even when properly linked) will display to 'link the account' again, resulting in never claiming the EA rewards.