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

Amazon Prime Gaming in game content claims fail #208

Closed
KairuByte opened this issue Sep 14, 2023 · 18 comments · Fixed by #249 or #274
Closed

Amazon Prime Gaming in game content claims fail #208

KairuByte opened this issue Sep 14, 2023 · 18 comments · Fixed by #249 or #274

Comments

@KairuByte
Copy link

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
Copy link

yoshimo commented Sep 22, 2023

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
Copy link
Contributor

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

Primajin added a commit to Primajin/free-games-claimer that referenced this issue Nov 12, 2023
The button was renamed to "Claim" instead of "Claim now" this causes / fixes vogler#208
@Mrgaton
Copy link

Mrgaton commented Dec 20, 2023

[AggregateError: All promises were rejected] {
[errors]: [
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] {
[errors]: [
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

Primajin added a commit to Primajin/free-games-claimer that referenced this issue Dec 20, 2023
The button was renamed to "Claim" instead of "Claim now" this causes / fixes vogler#208
@Mrgaton
Copy link

Mrgaton commented Dec 20, 2023

image
Also it doesnt claim this things

@KairuByte
Copy link
Author

KairuByte commented Dec 22, 2023

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

@vogler vogler reopened this Dec 22, 2023
@Primajin
Copy link
Contributor

Primajin commented Dec 22, 2023

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
Copy link
Contributor

Primajin commented Dec 22, 2023

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
Copy link

Mrgaton commented Dec 23, 2023

image
yes still not claiming it

@sealldeveloper
Copy link

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
Copy link
Owner

vogler commented Dec 23, 2023

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:

if [[ "${{ env.BRANCH }}" == "main" ]]; then
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
else
echo "IMAGE_TAG=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
fi

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

@vogler
Copy link
Owner

vogler commented Dec 23, 2023

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
Copy link

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

@Primajin
Copy link
Contributor

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
Copy link
Owner

vogler commented Dec 23, 2023

Can check/merge after lunch.

@Primajin
Copy link
Contributor

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

vogler added a commit that referenced this issue Dec 23, 2023
Use `.tw-button` css class over `button` html element selector
@sealldeveloper
Copy link

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
Copy link
Owner

vogler commented Dec 23, 2023

@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
Copy link

sealldeveloper commented Dec 23, 2023

@vogler This has happened with:

  • Destiny 2
  • League of Legends: Wild Rift
  • Legends of Runeterra
  • Overwatch 2

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment