コード例 #1
0
    def login(self,
              username: str,
              password: str,
              mafile=None,
              email=None,
              email_passwd=None,
              captcha_gid='-1',
              captcha_text='') -> None:
        shared_secret = self._fetch_shared_secret(mafile)
        self._session.headers.update(self.BROWSER_HEADERS)
        login_response = LoginExecutor(username, password, shared_secret,
                                       self._session, email, email_passwd,
                                       captcha_gid, captcha_text).login()
        try:
            self.steamid = login_response['transfer_parameters']['steamid']
        except KeyError as err:
            logger.info("%s: %s", err, login_response)
        # get steamcommunity cookies
        # self._session.get('https://steamcommunity.com/market/')

        # set english language
        self._session.post('https://steamcommunity.com/actions/SetLanguage/',
                           data={
                               'language': 'english',
                               'sessionid': self.get_session_id()
                           })

        self.isLoggedIn = True
        self.login_name = username
        self.password = password

        return login_response
コード例 #2
0
ファイル: client.py プロジェクト: miminhub/steampy
 def login(self, username: str, password: str, steam_guard: str) -> None:
     self.steam_guard = guard.load_steam_guard(steam_guard)
     self.username = username
     self._password = password
     LoginExecutor(username, 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())
コード例 #3
0
    def mobile_login(self,
                     username,
                     password,
                     mafile=None,
                     email=None,
                     email_passwd=None,
                     captcha_gid='-1',
                     captcha_text=''):
        shared_secret = self._fetch_shared_secret(mafile)
        self._session.headers.update(self.BROWSER_HEADERS)
        self._session.cookies.set('mobileClientVersion', '0 (2.1.3)')
        self._session.cookies.set('Steam_Language', 'english')
        self._session.cookies.set('mobileClient', 'android')
        login_response = LoginExecutor(username, password, shared_secret,
                                       self._session, email, email_passwd,
                                       captcha_gid,
                                       captcha_text).mobile_login()
        oauth = login_response.get('oauth', None)
        if oauth:
            self.oauth = json.loads(oauth)
            self.steamid = self.oauth['steamid']

        # get steamcommunity cookies
        # self._session.get('http://steamcommunity.com/market/')

        # set english language
        del self._session.cookies['Steam_Language']
        self._session.post('https://steamcommunity.com/actions/SetLanguage/',
                           data={
                               'language': 'english',
                               'sessionid': self.get_session_id()
                           })

        self.isLoggedIn = True
        self.login_name = username
        self.password = password

        return login_response
コード例 #4
0
ファイル: client.py プロジェクト: KokocGroup/steampy
 def login(self,
           username: str = None,
           password: str = None,
           steam_guard: str = None,
           rucaptcha_key: str = None) -> None:
     if steam_guard:
         self.steam_guard = guard.load_steam_guard(steam_guard)
     if username:
         self.username = username
     if password:
         self._password = password
     if rucaptcha_key:
         self._rucaptcha_key = rucaptcha_key
     LoginExecutor(self.username, self._password,
                   self.steam_guard['shared_secret'], self._session,
                   self._rucaptcha_key, self.rucaptcha_kwargs).login()
     self.was_login_executed = True
     self.market._set_login_executed(self.steam_guard,
                                     self._get_session_id())
コード例 #5
0
 async def login(self) -> None:
     session_loaded = False
     if self.reuse_session:
         session_loaded = await self.load_session()
         if session_loaded:
             print('session loaded')
         elif session_loaded == False:
             print('session is not alive any more')
     if not session_loaded:
         print('do classic login')
         login_executor = LoginExecutor(username=self.username,
                                        password=self._password,
                                        shared_secret=self._shared_secret,
                                        session=self._session)
         await login_executor.login()
     self.was_login_executed = True
     self.market._set_login_executed(steam_id=self.steam_id,
                                     session_id=self._get_session_id(),
                                     identity_secret=self._identity_secret)
     if self.reuse_session:
         self.save_session()
コード例 #6
0
ファイル: client.py プロジェクト: VVILD/steampy
 def login(self, username: str, password: str, steam_guard: str) -> None:
     self.steam_guard = guard.load_steam_guard(steam_guard)
     LoginExecutor(username, password, self.steam_guard['shared_secret'],
                   self._session).login()
     self.isLoggedIn = True
コード例 #7
0
ファイル: client.py プロジェクト: krystalgamer/steampy
 def login_email_auth(self, password: str, authCallback: Callable, saveCallback: Callable, steamAuth: dict):
     LoginExecutor(self.username, password, '', authCallback, saveCallback, steamAuth, self._session).login()
     self.was_login_executed = True
     self.market._set_login_executed(self.steam_guard, self._get_session_id())
     return