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.29k stars 142 forks source link

[Store/DLC] Claim in-game content on Amazon Prime #55

Open Underestimated opened 1 year ago

Underestimated commented 1 year ago

This is more of a nice to have thing, but within the Amazon Games site, a number of developers offer in game content and items (For example Two Point Hospital does every month) Would there be a way to enable claiming this alongside the free games?

The delivery mechanism is essentially the same as the existing games we’re claiming, and filtering could potentially be done by the listed game name, which each tile has on it, if we were to define in an environmental variable the names of the games we want to claim content for, then the tool could look for only those, and claim them.

As I said it’s not an urgent request or anything, if possible it would be a great value-add to the existing tool, especially if the existing code can be adapted to grab it with minimal effort.

vogler commented 1 year ago

I can check. Maybe some opt-in CLAIMDLC=1 - don't want the default stuff to fail or generate too much noise due to unlinked accounts etc.

sealldeveloper commented 1 year ago

I know for some games like Roblox content it just returns a key, maybe detecting if an account needs to be linked and if so if the account is linked? Seems like alot of work.

Underestimated commented 1 year ago

I know for some games like Roblox content it just returns a key, maybe detecting if an account needs to be linked and if so if the account is linked? Seems like alot of work.

That's pretty much how half amazon prime game claims work anyway, there's already an implementation of that as is, (codes output to console, notifications and screenshots directory) which is why I suggested this as an addition, seeing as the process isn't all that different. The only real changes is choosing how to select the DLC to claim, which is why I suggested using the game title that each card has rendered on it.

I can check. Maybe some opt-in CLAIMDLC=1 - don't want the default stuff to fail or generate too much noise due to unlinked accounts etc.

Thanks either way, as I said, more of a nice to have, as I'm having to do that manually. If I were to implement it, I'd make an environment variable for enabling it, and then another for an array of titles to check, which could be compared against the titles listed on the game cards on the amazon dashboard. Then it's on the user to define that properly.

EthanC commented 1 year ago

Understood PG_CLAIMDLC is experimental, but figured I'd give it a try seeing as it's in the latest release.

@vogler If it's of any use, I get a TimeoutError while trying to claim DLC. Additionally, an undefined notification is sent.

Logs

Number of already claimed DLC: 0
Number of unclaimed DLC: 28
Current DLC: Candy Crush Saga - 20 Gold Bars and more, free with Amazon Prime
page.inputValue: Timeout 60000ms exceeded.
=========================== logs ===========================
waiting for locator('input[type="text"]')
============================================================
    at file:///fgc/prime-gaming.js:277:33 {
  name: 'TimeoutError'
}

Notification

prime-gaming (Ethan):
- Candy Crush Saga - 20 Gold Bars and more, free with Amazon Prime (undefined)
testeur999 commented 1 year ago

Current DLC: Candy Crush Saga - 20 Gold Bars and more, free with Amazon Prime page.inputValue: Timeout 60000ms exceeded.

web page stay waiting to the qr code, then the time out exited

vogler commented 1 year ago

I guess that's where I stopped. It currently detects if an account needs to be linked and if a key is shown to be redeemed, but there are some Games/DLCs that have a different page layout (like Candy Crush with the QR code). Maybe I'll just wrap each iteration in a try/catch such that these edge cases don't stop everything.

KairuByte commented 1 year ago

I realize this is not officially supported yet, but I've noticed that while the script does get into the in-game content, it is never able to claim the content. It always says that linking is needed. Manual claiming works without a hitch for 99% of the offers.

yoshimo commented 1 year ago

you could limit it to games that you linked and own and want to get stuff for.

KairuByte commented 1 year ago

The games which are linked, still pop as failed due to the game not being linked.