steam icon indicating copy to clipboard operation
steam copied to clipboard

re-write webauth implementation for steam backend changes

Open aUniqueUser opened this issue 2 years ago • 8 comments

login/dologin/ was borked by valve, pr addresses issue by using the new login system

todo:

  • steam email/mobile guard support
  • replace WebAuth class with WebAuth2 class

aUniqueUser avatar Oct 24 '23 02:10 aUniqueUser

resolves https://github.com/ValvePython/steam/issues/451 https://github.com/ValvePython/steam/issues/450 after completion. https://github.com/ValvePython/steam/issues/452 will need to be looked into, anyone welcome to contribute.

aUniqueUser avatar Oct 24 '23 02:10 aUniqueUser

@aUniqueUser I gave a try with your code but it does not work. I tried this:

user = wa.WebAuth2(STEAM_BOT_NAME)
steam_session = user.login(STEAM_BOT_PASSWORD)

item_name="AK-47 | Aquamarine Revenge (Factory New)"
url = f"https://steamcommunity.com/market/pricehistory/?appid=730&market_hash_name={item_name}"
    
request = steam_session.get(url)
result = json.loads(request.text)
print(result)

but I get this exception: , line 144, in _startSessionWithCredentials self.clientID = r['response']['client_id'] ~~~~~~~~~~~~~^^^^^^^^^^^^^ KeyError: 'client_id' response is empty except for interval argument:

r = {'response': {'interval': 5, 'extended_error_message': ''}}

negstek avatar Oct 24 '23 21:10 negstek

Forget about my previous answer, you changed a bit the behavior of the login method so my legacy code failed but after a deeper look into your code it works fine using login with username and password attributes

user = wa.WebAuth2()
steam_session = user.login(STEAM_BOT_NAME, STEAM_BOT_PASSWORD)

item_name="AK-47 | Aquamarine Revenge (Factory New)"
url = f"https://steamcommunity.com/market/pricehistory/?appid=730&market_hash_name={item_name}"
    
request = steam_session.get(url)
result = json.loads(request.text)
print(result)

works fine, thank you very much for your help.

negstek avatar Oct 24 '23 22:10 negstek

Yea before final merge I will need to correct it to work better with legacy code, good to see it working though 👍

aUniqueUser avatar Oct 25 '23 00:10 aUniqueUser

Has anyone figured out how to add email authentication to this.

Revibess avatar Oct 27 '23 15:10 Revibess

Has anyone figured out how to add email authentication to this.

Yeah. I will write some staff into codebase and add pull request (about 1 day) mayble sooner, but it's 3 AM for me

artur1214 avatar Oct 27 '23 20:10 artur1214

Has anyone figured out how to add email authentication to this.

Yeah. I will write some staff into codebase and add pull request (about 1 day) mayble sooner, but it's 3 AM for me

No worries, take your time.

Revibess avatar Oct 28 '23 00:10 Revibess

I added

Has anyone figured out how to add email authentication to this.

Yeah. I will write some staff into codebase and add pull request (about 1 day) mayble sooner, but it's 3 AM for me

No worries, take your time.

I added some changes, and will add MUCH more later. you can check them out in another PR: https://github.com/ValvePython/steam/pull/454

artur1214 avatar Oct 28 '23 11:10 artur1214