bukson / steampy

A Steam trading library for python 3
MIT License
577 stars 157 forks source link

client_id #409

Open Aarab228 opened 3 weeks ago

Aarab228 commented 3 weeks ago

20:45:40 DEBUG | [Unknown] | Starting new HTTPS connection (1): steamcommunity.com:443 20:45:40 DEBUG | [Unknown] | https://steamcommunity.com:443 "POST / HTTP/1.1" 200 8588 20:45:40 DEBUG | [Unknown] | Starting new HTTPS connection (1): api.steampowered.com:443 20:45:41 DEBUG | [Unknown] | https://api.steampowered.com:443 "GET /IAuthenticationService/GetPasswordRSAPublicKey/v1?account_name=**** HTTP/1.1" 200 597 20:45:41 DEBUG | [Unknown] | https://api.steampowered.com:443 "POST /IAuthenticationService/BeginAuthSessionViaCredentials/v1 HTTP/1.1" 200 55 20:45:41 ERROR | [create_cookies] | Error: 'client_id'

`
def login(self, username: str = None, password: str = None, steam_guard: str = None) -> None: invalid_client_credentials_is_present = None in (self.username, self._password, self.steam_guard_string) invalid_login_credentials_is_present = None in (username, password, steam_guard)

    if invalid_client_credentials_is_present and invalid_login_credentials_is_present:
        raise InvalidCredentials(
            'You have to pass username, password and steam_guard parameters when using "login" method'
        )

    if invalid_client_credentials_is_present:
        self.steam_guard_string = steam_guard
        self.steam_guard = guard.load_steam_guard(self.steam_guard_string)
        self.username = username
        self._password = password

    if self.was_login_executed and self.is_session_alive():
        return  # Session is alive, no need to login again

    self._session.cookies.set('steamRememberLogin', 'true')
    LoginExecutor(self.username, self._password, self.steam_guard['shared_secret'], self._session).login()
    self.was_login_executed = True
    self.market._set_login_executed(self.steam_guard, self._get_session_id())`