tacheometry / steam-hour-farmer

Farm/boost/idle hours headlessly on Steam without game installation
https://npmjs.com/steam-hour-farmer
MIT License
28 stars 4 forks source link

InvalidPassword #2

Closed cRestalious closed 8 months ago

cRestalious commented 8 months ago

Hello,

After running the steam-hour-farmer I keep getting that the password is wrong, I have double checked it and the password is corrent, what could be the issue?

tacheometry commented 8 months ago

Can you send over the .env file you have (with the password, etc, censored, but keep the formatting) and the logs you got?

cRestalious commented 8 months ago

image I see no logs at the moment

tacheometry commented 8 months ago

image I see no logs at the moment

There shouldn't be any , after each line, try removing them and see if it's working

tacheometry commented 8 months ago

Oh no... it's like that in the documentation... I will fix it, thank you very much for reporting thisπŸ‘

cRestalious commented 8 months ago

Still getting the same issue, after removing these :/ image

tacheometry commented 8 months ago

Does your password have any special characters, different than a-Z 0-9, etc?

Also can you try removing the quotes and see if it works?

Also try to remove the SteamData folder each time you do a trial

tacheometry commented 8 months ago

I'll also update the package soon with an updated Steam library, maybe that fixes it...

cRestalious commented 8 months ago

Yeah it does. It has !@#$%^&*() characters

tacheometry commented 8 months ago

Hmm... maybe it's because of the way the env library handles it, see here: https://www.npmjs.com/package/dotenv#what-rules-does-the-parsing-engine-follow

Does it have spaces at the end? I don't know of other rules that'd affect this

cRestalious commented 8 months ago

No spaces at the end, its weird. Maybe I have to try with a different password? But still doesn't make sense.

tacheometry commented 8 months ago

No " \ or ' characters either?

cRestalious commented 8 months ago

In the password no

tacheometry commented 8 months ago

Ok, let's determine if this is actually caused by the password getting parsed incorrectly from the file or not...

  1. In your farmer directory, run npm i steam-hour-farmer
  2. Edit the file ./node_modules/steam-hour-farmer/index.js
  3. Right under the line
    require("dotenv").config();

    Insert the following so it looks like this:

    require("dotenv").config();
    console.log(`PASSWORD: [${process.env.PASSWORD}]`);
  4. Run the process using npx steam-hour-farmer (if you don't use npx it will use the global install which doesn't have modifications)
  5. Check if the text between the brackets matches your password EXACTLY

If it does match, then that's not the issue, and we can try with an updated library for login...

cRestalious commented 8 months ago

It does match, yes

cRestalious commented 8 months ago

Any updates?

tacheometry commented 8 months ago

Alright, I've investigated quite a bit... turns out it's not related to the password itself, at all... Steam also sends out the InvalidPassword error (error code 5) in the cases when the access token is invalid. I don't think one is being sent right now - not sure. But here's what I've observed

Currently, the CLI doesn't ask for any code received from the email (and an email isn't even being sent, because this verification isn't being requested). But running this script here as a test, this does ask for the email code. Afterwards, the outputted access token can be used for account login.

Interestingly, when I made this project, logging in was less rigorous, and I was also testing on my alt account that only had email verification. 1 month later, that changed, apparently! But I've been running steam-hour-farmer without issue, non-stop, since then. It's been almost two years...

To use steam-hour-farmer right now, you should be fine with setting up Steam Guard (I recommend SteamDesktopAuthenticator and setting SHARED_SECRET so it can re-log-in by itself without any manual intervention) and running it that way. Otherwise you can try using it again after I update it to support this method as well.

Thank you for reporting the initial issue and the sustained replies πŸ˜‰

cRestalious commented 8 months ago

Hm, thanks for the reply, I'm using Steam Guard but on mobile, could be that be the issue?

tacheometry commented 8 months ago

Shouldn't be the issue. But, are you on Windows?

cRestalious commented 8 months ago

Yes

tacheometry commented 8 months ago

Ok... now try it with the updated version. npm i -g steam-hour-farmer@latest should work. But delete everything in your folder other than the .env, and run normally.

You will also need to change USERNAME to ACCOUNT_NAME

Tell me if it works

cRestalious commented 8 months ago

Yep it worked. Thank you so much.

tacheometry commented 8 months ago

πŸ‘πŸ‘πŸ‘

On Windows, the USERNAME env variable is actually the Windows account name... so for me it was trying to log in with DevAccount (my account name) for example... I was so surprised when I found that out...

tacheometry commented 8 months ago

I didn't catch this initially because I made the project when I was maining Linux... disregard my other theories haha

cRestalious commented 8 months ago

That's interesting... Glad that it's solved now. thank you :D