當前位置: 首頁>>代碼示例>>Python>>正文


Python gpsoauth.perform_oauth方法代碼示例

本文整理匯總了Python中gpsoauth.perform_oauth方法的典型用法代碼示例。如果您正苦於以下問題:Python gpsoauth.perform_oauth方法的具體用法?Python gpsoauth.perform_oauth怎麽用?Python gpsoauth.perform_oauth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gpsoauth的用法示例。


在下文中一共展示了gpsoauth.perform_oauth方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: login

# 需要導入模塊: import gpsoauth [as 別名]
# 或者: from gpsoauth import perform_oauth [as 別名]
def login(self, username, password):
        self.log.info('Google login for: {}'.format(username))
        login = perform_master_login(username, password, self.GOOGLE_LOGIN_ANDROID_ID)
        login = perform_oauth(username, login.get('Token', ''), self.GOOGLE_LOGIN_ANDROID_ID, self.GOOGLE_LOGIN_SERVICE, self.GOOGLE_LOGIN_APP,
            self.GOOGLE_LOGIN_CLIENT_SIG)
            
        self._auth_token = login.get('Auth')
        
        if self._auth_token is None:
            self.log.info('Google Login failed.')
            return False
        
        self._login = True
            
        self.log.info('Google Login successful.')
        self.log.debug('Google Session Token: %s', self._auth_token[:25])

        return True 
開發者ID:Haven-Lau,項目名稱:Pokemon-Go-FB-Bot,代碼行數:20,代碼來源:auth_google.py

示例2: createGoogleSession

# 需要導入模塊: import gpsoauth [as 別名]
# 或者: from gpsoauth import perform_oauth [as 別名]
def createGoogleSession(self, locationLookup='', session=None, noop=False):

        logging.info('Creating Google session for %s', self.username)

        r1 = perform_master_login(self.username, self.password, ANDROID_ID)
        r2 = perform_oauth(
            self.username,
            r1.get('Token', ''),
            ANDROID_ID,
            SERVICE,
            APP,
            CLIENT_SIG
        )

        self.access_token = r2.get('Auth')  # access token
        return self.createPogoSession(
            provider='google',
            locationLookup=locationLookup,
            session=session,
            noop=noop
        ) 
開發者ID:cglatot,項目名稱:PokeManager,代碼行數:23,代碼來源:api.py

示例3: login_google

# 需要導入模塊: import gpsoauth [as 別名]
# 或者: from gpsoauth import perform_oauth [as 別名]
def login_google(account):
    ANDROID_ID = '9774d56d682e549c'
    SERVICE = 'audience:server:client_id:848232511240-7so421jotr2609rmqakceuu1luuq0ptb.apps.googleusercontent.com'
    APP = 'com.nianticlabs.pokemongo'
    APP_SIG = '321187995bc7cdc2b5fc91b11a96e2baa8602c62'
    while True:
        try:
            login1 = perform_master_login(account['user'], account['pw'], ANDROID_ID)
            while login1.get('Token') is None:
                lprint('[{}] Google Login error, retrying... (step 1)'.format(account['num']))
                time.sleep(2)
                login1 = perform_master_login(account['user'], account['pw'], ANDROID_ID)

            login2 = perform_oauth(account['user'], login1.get('Token'), ANDROID_ID, SERVICE, APP, APP_SIG)
            while login2.get('Auth') is None:
                lprint('[{}] Google Login error, retrying... (step 2)'.format(account['num']))
                time.sleep(2)
                login2 = perform_oauth(account['user'], login1.get('Token', ''), ANDROID_ID, SERVICE, APP, APP_SIG)

            access_token = login2['Auth']
            account['access_expire_timestamp'] = 7200000 - 30000 + get_time() #int(login2['Expiry'])*1000
            account['access_token'] = access_token
            return
        except Exception as e:
            lprint('[{}] Unexpected google login error: {}'.format(account['num'], e))
            lprint('[{}] Retrying...'.format(account['num']))
            time.sleep(1) 
開發者ID:seikur0,項目名稱:PGO-mapscan-opt,代碼行數:29,代碼來源:main0.py

示例4: get_access_token

# 需要導入模塊: import gpsoauth [as 別名]
# 或者: from gpsoauth import perform_oauth [as 別名]
def get_access_token(self, force_refresh=False):
        token_validity = self.check_access_token()

        if token_validity is True and force_refresh is False:
            self.log.debug('Using cached Google Access Token')
            return self._access_token
        else:
            if force_refresh:
                self.log.info('Forced request of Google Access Token!')
            else:
                self.log.info('Request Google Access Token...')

            token_data = perform_oauth(None, self._refresh_token, self.GOOGLE_LOGIN_ANDROID_ID, self.GOOGLE_LOGIN_SERVICE, self.GOOGLE_LOGIN_APP,
                self.GOOGLE_LOGIN_CLIENT_SIG)

            access_token = token_data.get('Auth', None)
            if access_token is not None:
                self._access_token = access_token
                self._access_token_expiry = int(token_data.get('Expiry', 0))
                self._login = True

                self.log.info('Google Access Token successfully received.')
                self.log.debug('Google Access Token: %s...', self._access_token[:25])
                return self._access_token
            else:
                self._access_token = None
                self._login = False
                raise AuthException("Could not receive a Google Access Token") 
開發者ID:PokeHunterProject,項目名稱:pogom-linux,代碼行數:30,代碼來源:auth_google.py

示例5: login_google

# 需要導入模塊: import gpsoauth [as 別名]
# 或者: from gpsoauth import perform_oauth [as 別名]
def login_google(username, password):
    print '[!] Google login for: {}'.format(username)
    r1 = perform_master_login(username, password, ANDROID_ID)
    r2 = perform_oauth(username,
                       r1.get('Token', ''),
                       ANDROID_ID,
                       SERVICE,
                       APP,
                       CLIENT_SIG, )
    return r2.get('Auth') 
開發者ID:rubenmak,項目名稱:PokemonGo-SlackBot,代碼行數:12,代碼來源:pokehomey.py

示例6: get_access_token

# 需要導入模塊: import gpsoauth [as 別名]
# 或者: from gpsoauth import perform_oauth [as 別名]
def get_access_token(self, force_refresh = False):
        token_validity = self.check_access_token()

        if token_validity is True and force_refresh is False:
            self.log.debug('Using cached Google Access Token')
            return self._access_token
        else:
            if force_refresh:
                self.log.info('Forced request of Google Access Token!')
            else:
                self.log.info('Request Google Access Token...')

            token_data = perform_oauth(None, self._refresh_token, self.GOOGLE_LOGIN_ANDROID_ID, self.GOOGLE_LOGIN_SERVICE, self.GOOGLE_LOGIN_APP,
                self.GOOGLE_LOGIN_CLIENT_SIG)

            access_token = token_data.get('Auth', None)
            if access_token is not None:
                self._access_token = access_token
                self._access_token_expiry = int(token_data.get('Expiry', 0))
                self._login = True

                self.log.info('Google Access Token successfully received.')
                self.log.debug('Google Access Token: %s...', self._access_token[:25])
            else:
                self._access_token = None
                self._login = False
                raise AuthException("Could not receive a Google Access Token") 
開發者ID:joaoanes,項目名稱:pokescan,代碼行數:29,代碼來源:auth_google.py

示例7: login_google

# 需要導入模塊: import gpsoauth [as 別名]
# 或者: from gpsoauth import perform_oauth [as 別名]
def login_google(username, password):
    print('[!] Google login for: {}'.format(username))
    r1 = perform_master_login(username, password, ANDROID_ID)
    r2 = perform_oauth(username, r1.get('Token', ''), ANDROID_ID, SERVICE, APP,
        CLIENT_SIG)

    return r2.get('Auth') # access token 
開發者ID:joaoanes,項目名稱:pokescan,代碼行數:9,代碼來源:main.py

示例8: get_access_token

# 需要導入模塊: import gpsoauth [as 別名]
# 或者: from gpsoauth import perform_oauth [as 別名]
def get_access_token(self, username, password):
        r1 = perform_master_login(username, password, ANDROID_ID)
        r2 = perform_oauth(username, r1.get('Token', ''), ANDROID_ID, SERVICE, APP, CLIENT_SIG)
        return r2.get('Auth') 
開發者ID:mayank26saxena,項目名稱:PokeBot,代碼行數:6,代碼來源:google.py


注:本文中的gpsoauth.perform_oauth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。