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

✨ [REQUEST] free-games-claimer #747

Closed
amosyuen opened this issue Mar 6, 2023 · 79 comments
Closed

✨ [REQUEST] free-games-claimer #747

amosyuen opened this issue Mar 6, 2023 · 79 comments
Labels
bug Something isn't working enhancement New feature or request stale Element will be closed automatically

Comments

@amosyuen
Copy link

amosyuen commented Mar 6, 2023

!!! I have a real life job in parallel to this addon, and don't think I'll be able to add new addons for the moment. You can still however express your interest in case someone would do it

Which addon?
https://github.com/vogler/free-games-claimer. Supports epic games, prime gaming and GOG

Is your feature request related to a problem? Please describe.
Claim free games from multiple services.

**If a new addon, have you checked on Google that such as addon doesn't already exists?**
Yes

Describe the solution you'd like

Configure single add-on to claim all free games.

Describe alternatives you've considered

Not aware of other alternatives

@amosyuen amosyuen added enhancement New feature or request prevent stale Prevents stale being applied labels Mar 6, 2023
@diamant-x
Copy link

there's an epic games one already.

https://github.com/alexbelgium/hassio-addons/tree/master/epicgamesfree

@amosyuen
Copy link
Author

amosyuen commented Mar 7, 2023

That one always prompts for a security code every checkout for me so isn't that helpful. free-games-claimer doesn't prompt and supports more accounts.

@KairuByte
Copy link
Contributor

Oh my goodness, thank you For bringing this project to my attention. It seems they are looking to as even more services to The grabber as well!

@hacshacdgacs
Copy link

As someone who's had issues with the epicgamesfree addon in the past (was unable to get it to actually claim games because of the captcha) I would also like this if possible.

@alexbelgium
Copy link
Owner

I'll look at it

@alexbelgium
Copy link
Owner

Would this addon remove the epicgamesfree one? For sake of simplification

@hacshacdgacs
Copy link

hacshacdgacs commented May 22, 2023 via email

alexbelgium added a commit that referenced this issue May 22, 2023
alexbelgium added a commit that referenced this issue May 22, 2023
@KairuByte
Copy link
Contributor

I think it makes sense to keep both. They use different methods, and epic games free tends to be much more reliable from what I'm seeing.

@alexbelgium
Copy link
Owner

Is the latest working?

@alexbelgium alexbelgium removed prevent stale Prevents stale being applied Priority labels May 23, 2023
@KairuByte
Copy link
Contributor

KairuByte commented May 23, 2023

The latest egf is still working, and the latest container for fgc is working. I tried to set up the fgc addon last night but ran into issues with it accepting creds from the config file, so need to sit down today and figure out what's going on.

@alexbelgium
Copy link
Owner

alexbelgium commented May 23, 2023

In theory values from the config file (in yaml format) are exported as env variables

@KairuByte
Copy link
Contributor

KairuByte commented May 23, 2023

I'm not sure why, but I am getting constant stalls on start. It gets to the point that I am seeing output from the container, but it just stops sometimes moments after it starts up. Is that likely an issue with the container itself, or is that potentially a misconfiguration on the addon "wrapper" side?

Edit: Seems to come and go. I was just able to get it running, but it doesn't seem to be reading the values from the config file. Looking through the repo, I think it may have an incorrect file extension? The docs read like we should be interacting with config.env not config.yaml.

@alexbelgium
Copy link
Owner

alexbelgium commented May 23, 2023

Well config.yaml is my internet system to export env variables. Not sure about config.env

@MaxWinterstein
Copy link
Contributor

Just found a minute and was going to check if 'epic-games-free' is fixable, and was confused where the readme part was gone. Found that you renamed the whole folder, therefore it looked 'abandoned' to me.

Tried the new 'free-games-claimer' - currently shown as 'epic-games-free' and had just one weird thing. It was not showing the novnc server, nor something useful in the logs. After adding a real port to the VNC port mapping everything started fine. After removing it still works fine. Not sure how settings are handled internally, and if a setting that once was overwritten is now empyt/null - or at least other than it was before.

To make every business consultant happy, here is the positive feedback: Would be nice to select which game plattforms i would like to check, as e.g. I have no usage of amazon prime gaming.

Keep up the good work ✌️

@KairuByte
Copy link
Contributor

Yeah, I'm having trouble getting novnc running here as well, and my entries in the config file don't seem to be working at all. I tried adding a vnc port in the network config section of the addon to no avail. I may need to remove and re-add or something.

As for picking and choosing which service works, technically the following command can be appended to the end of the docker run command to achieve that, leaving out what you don't want: bash -c node epic-games; node prime-gaming; node gog it may be possible to incorporate that into the plugin but I'm not sure.

@alexbelgium
Copy link
Owner

Great idea, I'll do that in next version

alexbelgium added a commit that referenced this issue May 24, 2023
@alexbelgium
Copy link
Owner

Latest version includes custom commands through addon options as you propose, and usage of the config.env instead of my config.yaml. The config.env uses the nomenclature KEY=VALUE instead of the previous yaml that was KEY: VALUE

@alexbelgium
Copy link
Owner

Just found a minute and was going to check if 'epic-games-free' is fixable, and was confused where the readme part was gone. Found that you renamed the whole folder, therefore it looked 'abandoned' to me.

Hi - sorry this was unintended, I had pushed the folder in the free-games-claimer one on explorer :-) corrected now

@KairuByte
Copy link
Contributor

Errors with the following output now:

/./etc/cont-init.d/99-run.sh: line 44: syntax error near unexpected token `}'
 
/etc/cont-init.d/99-run.sh: exiting 2

alexbelgium added a commit that referenced this issue May 24, 2023
alexbelgium added a commit that referenced this issue May 24, 2023
@alexbelgium
Copy link
Owner

Not working yet

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Element will be closed automatically label Jun 10, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2023
@KairuByte
Copy link
Contributor

KairuByte commented Jun 16, 2023

Apologies for the late follow up. I’ve been able to test and can confirm things run. However. Sequential running may not work?

 
[23:29:23] INFO: Starting the app with arguments "node epic-games"
Xvfb display server created screen with resolution 1024x768
VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080
2023-06-15 23:29:25.819 started checking epic-games
Signed in as *********
Free games: [
  'https://store.epicgames.com/en-US/p/guacamelee-2-ac4977',
  'https://store.epicgames.com/en-US/p/guacamelee-stce-7cdbc8'
]
Current free game: Guacamelee! 2
  Already in library! Nothing to claim.
Current free game: Guacamelee! Super Turbo Championship Edition
  Already in library! Nothing to claim.
 
[23:30:59] INFO: Starting the app with arguments "node prime-gaming"
 
Xvfb display server created screen with resolution 1024x768
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(EE) 
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE) 
 
[23:30:59] INFO: Starting the app with arguments "node gog"
 
Xvfb display server created screen with resolution 1024x768
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(EE) 
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE) 
[23:30:59] INFO: All actions concluded, addon will stop in 10 seconds

@alexbelgium
Copy link
Owner

Hi, indeed sequential running is executed but doesn't connect... Well I'll have to look again

@alexbelgium alexbelgium reopened this Jun 16, 2023
@github-actions github-actions bot removed the stale Element will be closed automatically label Jun 16, 2023
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Element will be closed automatically label Jun 22, 2023
@KairuByte
Copy link
Contributor

Bad bot

@alexbelgium
Copy link
Owner

Well it reminded me of this sorry I was quite caught up in work. I'll have a look again soon

@KairuByte
Copy link
Contributor

Haha no worries, it's not like you're paid to do this, and I'm fairly certain you don't even have a use for this particular add-on.

@github-actions github-actions bot removed the stale Element will be closed automatically label Jun 23, 2023
@alexbelgium alexbelgium added the bug Something isn't working label Jun 28, 2023
alexbelgium added a commit that referenced this issue Jun 28, 2023
@alexbelgium
Copy link
Owner

Hi, I think I got it in version test22. Please let me know!

@amosyuen
Copy link
Author

NoVNC still isn't working for me. But looks like it's able to claim epic games for me.

@KairuByte
Copy link
Contributor

Things kinda work now.

Honestly, I think I’m going to revert to using my PC and waking it to handle this… It seems horribly slow on a Pi, and sometimes takes so long things break. I think this may just be an inherent limitation of the Pi and/or image.

@hacshacdgacs
Copy link

VNC doesn't work for me either but can confirm that Epic and GOG will claim games without me needing to restart the addon. I'm running this on an old machine and not having any issues with the speed @KairuByte so that may just be a Pi issue.

@alexbelgium
Copy link
Owner

alexbelgium commented Jun 30, 2023

I think VNC doesn't work due to rpi being too slow... It didn't work on my rpi4 either...

Regarding the script in itself however it seems to run fine on my rpi4 !

Then can we close this? And consider that we'll just don't have noVNC on rpi...

@github-actions
Copy link
Contributor

github-actions bot commented Jul 5, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Element will be closed automatically label Jul 5, 2023
@alexbelgium
Copy link
Owner

Closed with disclaimer that novnc does not work but that the add-on can still work using the config file

@amosyuen
Copy link
Author

amosyuen commented Jul 22, 2023

Hi, would you consider an option to mount a config directory instead of just the config file? Reasons are:

  1. Browser state is saved there. For accounts that need manual 2FA input (such as GOG) a user could run the container manually in terminal and input the 2FA code, then copy the browser data to HA to run automatically.
  2. There are options like RECORD=1 that will record a video to help debug problems in config/record directory, but since directory isn't mounted there isn't an easy way to access the recorded file.

@Teberon
Copy link

Teberon commented Dec 29, 2023

I am missing something here... I configured the env correctly adding discord, eg, ap, and gog but there's no way to open anything. How do I use this: "Please use config.env to execute the script"?

I get these messages on Discord:
prime-gaming failed: page.waitForURL: Timeout 180000ms exceeded.

That is my config.env with reducted information

# NOTIFY='discord://{}/[]' -(Disabled to avoid Discord Spam, but works fine)
EG_EMAIL='[]@[]'
EG_PASSWORD='[]'
EG_OTPKEY='[]'
PG_EMAIL='[]@[]'
PG_PASSWORD='[]'
PG_REDEEM=1
PG_CLAIMDLC=1
PG_OTPKEY='[]'
GOG_EMAIL='[]'
GOG_PASSWORD='[]'
GOG_NEWSLETTER=1

That's the log information until after epic games (others are similar)

Starting...
/etc/cont-init.d/00-banner.sh: executing

-----------------------------------------------------------
 Add-on: Free Games Claimer (NoVNC not working)
 automatically claims free games on the Epic Games Store, Amazon Prime Gaming and GOG
-----------------------------------------------------------
 Add-on version: 1.5-3
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.2  (amd64 / generic-x86-64)
 Home Assistant Core: 2023.12.4
 Home Assistant Supervisor: 2023.12.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
-----------------------------------------------------------
 Provided by: https://github.com/alexbelgium/hassio-addons 
-----------------------------------------------------------
/etc/cont-init.d/00-global_var.sh: executing
CMD_ARGUMENTS='node epic-games ; node prime-gaming ; node gog'
CONFIG_LOCATION='/config/addons_config/free_games_claimer/config.env'
Timezone set from Etc/UTC to Europe/Warsaw
/etc/cont-init.d/01-config_yaml.sh: executing
Watch-out: your CONFIG_LOCATION should end by config.yaml, and instead it is config.env
Load environment variables from /config/addons_config/free_games_claimer/config.env if existing
---------------------------------------------------------
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables
/config/addons_config/free_games_claimer/config.env
  9:81      warning  line too long (82 > 80 characters)  (line-length)
  16:1      error    syntax error: expected '<document start>', but found '<scalar>' (syntax)

... config file has an invalid yaml format. Please check the file in /config/addons_config/free_games_claimer/config.env. Errors list above.
Error : /etc/cont-init.d/01-config_yaml.sh exiting 1
/etc/cont-init.d/01-custom_script.sh: executing
Execute /config/addons_autoscripts/free-games-claimer.sh if existing
---------------------------------------------------------
... no script found, exiting
Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation
/etc/cont-init.d/20-folders.sh: executing
Creating config location ...
Copying files if needed...
/etc/cont-init.d/99-run.sh: executing
[21:54:42] WARNING: The config.env file found in /config/addons_config/free_games_claimer will be used. Please customize according to https://github.com/vogler/free-games-claimer/tree/main#configuration--options and restart the add-on

[21:54:42] INFO: Getting variables from /config/addons_config/free_games_claimer/config.env

[21:54:42] INFO: Starting the app with arguments "node epic-games"
Version: https://github.com/vogler/free-games-claimer/tree/11db31ea46bf1fd0ec67144f484d3b151ba569b5
Build: Mon, 06 Nov 2023 18:41:08 +0000
Xvfb display server created screen with resolution 1920x1080
VNC is running on port 5900 (no password!)
noVNC (VNC via browser) is running on http://localhost:6080

2023-12-29 21:54:42.885 started checking epic-games
Open http://localhost:6080 to login inside the docker container.
Not signed in anymore. Please login in the browser or here in the terminal.
Login timeout is 180 seconds!
Using email and password from environment.
--- Exception:
page.fill: Timeout 180000ms exceeded.
=========================== logs ===========================
waiting for locator('#password')
============================================================
    at /data/epic-games.js:89:18 {
  name: 'TimeoutError'
}

When I click on Open WebUI I get an endless loading tab opened.

@alexbelgium
Copy link
Owner

Hi, I don't use the addon so can't help you with the config.env content. However, I can see from your log that the config.env file is correctly loaded by the addon Getting variables from /config/addons_config/free_games_claimer/config.env

So you would have more chance trying on their repo https://github.com/vogler/free-games-claimer. From the log it seems you haven't filled a #password tag in the config.env but they would know better than me what that means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request stale Element will be closed automatically
Projects
None yet
Development

No branches or pull requests

9 participants