Example #1
0
    def __init__(self, auth, username, password, latitude, longitude):
        self.auth = auth
        self.username = username
        self.password = password
        self.latitude = latitude
        self.longitude = longitude

        self.player_stats = {}
        self.pokemon = {}

        # Player State
        self.warned = None
        self.banned = None

        # Things needed for requests
        self.inventory_timestamp = None

        # instantiate pgoapi
        self.api = PGoApi()
        self.api.activate_hash_server(cfg_get('hash_key'))
        self.api.set_position(self.latitude, self.longitude,
                              random.randrange(3, 170))
        self.last_request = None

        if have_proxies():
            self.proxy = get_new_proxy()
            self.log_info("Using Proxy: {}".format(self.proxy))
            self.api.set_proxy({'http': self.proxy, 'https': self.proxy})
Example #2
0
def main():
    # log settings
    # log format
    logging.basicConfig(level=logging.DEBUG, format='%(asctime)s [%(module)10s] [%(levelname)5s] %(message)s')
    # log level for http request class
    logging.getLogger("requests").setLevel(logging.WARNING)
    # log level for main pgoapi class
    logging.getLogger("pgoapi").setLevel(logging.INFO)
    # log level for internal pgoapi class
    logging.getLogger("rpc_api").setLevel(logging.INFO)

    config = init_config()
    if not config:
        return

    if config.debug:
        logging.getLogger("requests").setLevel(logging.DEBUG)
        logging.getLogger("pgoapi").setLevel(logging.DEBUG)
        logging.getLogger("rpc_api").setLevel(logging.DEBUG)

    splitloc = config.location.split(",")
    position = (float(splitloc[0]), float(splitloc[1]), 0)
    if config.test:
        return

    # instantiate pgoapi
    api = PGoApi()

    # provide player position on the earth
    api.set_position(*position)

    if not api.login(config.auth_service, config.username, config.password):
        return
Example #3
0
    def initialize_api(self):
        device_info = get_device_info(self.account)
        self.logged_in = False
        self.ever_authenticated = False
        self.empty_visits = 0
        self.account_seen = 0

        self.api = PGoApi(device_info=device_info)
        if config.HASH_KEY:
            self.api.activate_hash_server(config.HASH_KEY)
        self.api.set_position(*self.location)
        if self.proxy:
            self.api.set_proxy({'http': self.proxy, 'https': self.proxy})
        self.api.set_logger(self.logger)
        if self.account.get('provider') == 'ptc' and self.account.get(
                'refresh'):
            self.api._auth_provider = AuthPtc(
                username=self.username,
                password=self.account['password'],
                timeout=config.LOGIN_TIMEOUT)
            self.api._auth_provider.set_refresh_token(
                self.account.get('refresh'))
            self.api._auth_provider._access_token = self.account.get('auth')
            self.api._auth_provider._access_token_expiry = self.account.get(
                'expiry')
            if self.api._auth_provider.check_access_token():
                self.api._auth_provider._login = True
                self.logged_in = True
                self.ever_authenticated = True
Example #4
0
 def __init__(
     self,
     group=None,
     target=None,
     name=None,
     worker_no=None,
     points=None,
 ):
     super(Slave, self).__init__(group, target, name)
     self.worker_no = worker_no
     local_data.worker_no = worker_no
     self.points = points
     self.count_points = len(self.points)
     self.step = 0
     self.cycle = 0
     self.seen_per_cycle = 0
     self.total_seen = 0
     self.error_code = None
     self.running = True
     center = self.points[0]
     self.api = PGoApi()
     self.api.activate_signature(config.ENCRYPT_PATH)
     self.api.set_position(center[0], center[1], 100)  # lat, lon, alt
     if hasattr(config, 'PROXIES') and config.PROXIES:
         self.api.set_proxy(config.PROXIES)
Example #5
0
def accept_tos_helper(username, password, location, proxy):
    print "Trying to accept Terms of Service for {}.".format(username)
    failMessage = "Maybe the HTTPS proxy is not working? {} did not accept Terms of Service.".format(
        username)

    api = PGoApi()
    if proxy != None:
        api.set_proxy({"https": proxy})

    location = location.replace(" ", "")
    location = location.split(",")
    api.set_position(float(location[0]), float(location[1]), 0.0)
    api.set_authentication(provider='ptc',
                           username=username,
                           password=password)
    response = api.app_simulation_login()
    if response == None:
        print "Servers do not respond to login attempt. " + failMessage
        return

    time.sleep(1)
    req = api.create_request()
    req.mark_tutorial_complete(tutorials_completed=0,
                               send_marketing_emails=False,
                               send_push_notifications=False)
    response = req.call()
    if response == None:
        print "Servers do not respond to accepting the ToS. " + failMessage
        return

    print('Accepted Terms of Service for {}'.format(username))
Example #6
0
def solveCaptchas(mode, username, password, location, captchakey2):
    print(mode)
    print(username)
    print(password + "|")
    captchatimeout=1000
    login_retry = 0
    
    user_agent = ("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) " + "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36")
    api = PGoApi()
    location = location.replace(" ", "")
    location = location.split(",")
    api.set_position(float(location[0]), float(location[1]), 0.0)
    while (login_retry < 3):
        print("Login...")
        if api.login(mode, username, password):
            break
        login_retry = login_retry + 1
    if(login_retry == 3):
        print(("Login failed for {user}. Check data and try again.").format(user = username))
        return
    time.sleep(10)
    req = api.create_request()
    req.check_challenge()
    response = req.call()
    
    captcha_url = response['responses']['CHECK_CHALLENGE']['challenge_url'];
    
    
    if len(captcha_url) == 1:
        print(("No captcha for user: {user}").format(user = username))
        #skip, captcha not necessary
    else:
        print(("Captcha required for user: {user}").format(user = username))
	#print("CaptchaURL: {}".format(captcha_url))
        if captchakey2 != "":
            dcap = dict(DesiredCapabilities.PHANTOMJS)
            dcap["phantomjs.page.settings.userAgent"] = user_agent
            driver = webdriver.PhantomJS(desired_capabilities=dcap)
        else:
            driver = webdriver.Chrome()
            driver.set_window_size(600, 600)
            
        driver.get(captcha_url)
        
        if captchakey2 == "":
            #Do manual captcha entry
            print("You did not pass a 2captcha key. Please solve the captcha manually.")
            elem = driver.find_element_by_class_name("g-recaptcha")
            driver.execute_script("arguments[0].scrollIntoView(true);", elem)
            # Waits 1 minute for you to input captcha
            try:
                WebDriverWait(driver, 60).until(EC.text_to_be_present_in_element_value((By.NAME, "g-recaptcha-response"), ""))
                print "Solved captcha"
                token = driver.execute_script("return grecaptcha.getResponse()")
                #print ("Recaptcha token: {}".format(token))
                activateUser(api, token)
                time.sleep(1)
            except TimeoutException, err:
                print("Timed out while manually solving captcha")
        else:
Example #7
0
def setup_api(args, status, account):
    reset_account(account)
    # Create the API instance this will use.
    if args.mock != '':
        api = FakePogoApi(args.mock)
    else:
        identifier = account['username'] + account['password']
        device_info = generate_device_info(identifier)
        api = PGoApiWrapper(PGoApi(device_info=device_info))

    # New account - new proxy.
    if args.proxy:
        # If proxy is not assigned yet or if proxy-rotation is defined
        # - query for new proxy.
        if ((not status['proxy_url']) or (args.proxy_rotation != 'none')):

            proxy_num, status['proxy_url'] = get_new_proxy(args)
            if args.proxy_display.upper() != 'FULL':
                status['proxy_display'] = proxy_num
            else:
                status['proxy_display'] = status['proxy_url']

    if status['proxy_url']:
        log.debug('Using proxy %s', status['proxy_url'])
        api.set_proxy({
            'http': status['proxy_url'],
            'https': status['proxy_url']
        })
        if (status['proxy_url'] not in args.proxy):
            log.warning(
                'Tried replacing proxy %s with a new proxy, but proxy ' +
                'rotation is disabled ("none"). If this isn\'t intentional, ' +
                'enable proxy rotation.', status['proxy_url'])

    return api
Example #8
0
def boot(service_container):
    # PoGoApi parameters
    config = service_container.get('config.core')

    if os.path.isfile(os.path.join(os.getcwd(), config['load_library'])):
        config['load_library'] = os.path.join(os.getcwd(),
                                              config['load_library'])

    service_container.set_parameter('pogoapi.provider',
                                    config['login']['auth_service'])
    service_container.set_parameter('pogoapi.username',
                                    config['login']['username'])
    service_container.set_parameter('pogoapi.password',
                                    config['login']['password'])
    service_container.set_parameter('pogoapi.shared_lib',
                                    config['load_library'])

    service_container.register_singleton('pgoapi', PGoApi())
    service_container.register_singleton(
        'google_maps', googlemaps.Client(key=config["mapping"]["gmapkey"]))

    if config['movement']['path_finder'] in ['google', 'direct']:
        service_container.set_parameter(
            'path_finder', config['movement']['path_finder'] + '_path_finder')
    else:
        raise Exception('You must provide a valid path finder')

    if config['movement']['navigator'] in ['fort', 'waypoint', 'camper']:
        service_container.set_parameter(
            'navigator', config['movement']['navigator'] + '_navigator')
    else:
        raise Exception('You must provide a valid navigator')
Example #9
0
def setup_api(args, status):
    # Create the API instance this will use.
    if args.mock != '':
        api = FakePogoApi(args.mock)
    else:
        device_info = generate_device_info()
        api = PGoApi(device_info=device_info)

    # New account - new proxy.
    if args.proxy:
        # If proxy is not assigned yet or if proxy-rotation is defined
        # - query for new proxy.
        if ((not status['proxy_url']) or
                ((args.proxy_rotation is not None) and
                 (args.proxy_rotation != 'none'))):

            proxy_num, status['proxy_url'] = get_new_proxy(args)
            if args.proxy_display.upper() != 'FULL':
                status['proxy_display'] = proxy_num
            else:
                status['proxy_display'] = status['proxy_url']

    if status['proxy_url']:
        log.debug('Using proxy %s', status['proxy_url'])
        api.set_proxy({
            'http': status['proxy_url'],
            'https': status['proxy_url']})

    return api
Example #10
0
    def __init__(self, scan_config):
        Thread.__init__(self)
        self.daemon = True
        self.name = 'search_thread'

        self.api = PGoApi(config['SIGNATURE_LIB_PATH'])
        self.scan_config = scan_config
Example #11
0
def api_init(account):
    api = PGoApi()
    
    try:
        api.set_position(360,360,0)  
        api.set_authentication(provider = account.auth_service,\
                               username = account.username, password =  account.password)
        api.activate_signature(get_encryption_lib_path()); time.sleep(1); api.get_player()
    
    except AuthException:
        log.error('Login for %s:%s failed - wrong credentials?' % (account.username, account.password))
        return None
    
    else:
        time.sleep(1); response = api.get_inventory()
        
        if response:
            if 'status_code' in response:
                if response['status_code'] == 1 or response['status_code'] == 2: return api
                
                elif response['status_code'] == 3:
                    # try to accept ToS
                    time.sleep(5); response = api.mark_tutorial_complete(tutorials_completed = 0,\
                                    send_marketing_emails = False, send_push_notifications = False)                    

                    if response['status_code'] == 1 or response['status_code'] == 2:
                        print('Accepted TOS for %s' % account.username)
                        return api
                    
                    elif response['status_code'] == 3:
                        print('Account %s BANNED!' % account.username)
                        raise AccountBannedException; return None
                
    return None
Example #12
0
def entry():
    args = parse_arguments(sys.argv[1:])
    api = PGoApi()

    prog = re.compile("^(\-?\d+\.\d+),?\s?(\-?\d+\.\d+)$")
    res = prog.match(args.location)
    if res:
        print('Using the following coordinates: {}'.format(args.location))
        position = (float(res.group(1)), float(res.group(2)), 0)
    else:
        print(('Failed to parse the supplied coordinates ({}).' +
               ' Please try again.').format(args.location))
        return

    if args.hash_key:
        print "Using hash key: {}.".format(args.hash_key)
        api.activate_hash_server(args.hash_key)

    with open(str(args.file)) as f:
        credentials = [x.strip().split(',')[0:] for x in f.readlines()]

    for provider, username, password in credentials:
        try:
            if check_account(provider, username, password, position, api):
                # Success!
                csv_format = provider + ',' + username + ',' + password
                appendFile(csv_format, 'working.csv')
        except ServerSideRequestThrottlingException:
            print('Server side throttling, waiting for 10 seconds.')
            time.sleep(10)
            check_account(provider, username, password, position, api)
        except NotLoggedInException:
            print('Could not login, waiting for 10 seconds.')
            time.sleep(10)
            check_account(provider, username, password, position, api)
Example #13
0
    def __init__(self, auth, username, password, job_queue):
        self.auth = auth
        self.username = username
        self.password = password
        self.job_queue = job_queue

        # Stats
        self.last_request = None
        self.previous_encounter = None
        self.last_msg = ""
        self.total_encounters = 0

        # Things needed for requests
        self.inventory_timestamp = None

        # Collects the last few pauses between encounters to measure a "encounters per hour" value
        self.past_pauses = deque()
        self.encounters_per_hour = float(0)

        # instantiate pgoapi
        self.api = PGoApi()
        self.api.activate_hash_server(cfg_get('hash_key'))

        if have_proxies():
            self.proxy = get_new_proxy()
            self.log_info("Using Proxy: {}".format(self.proxy))
            self.api.set_proxy({
                'http': self.proxy,
                'https': self.proxy
            })
Example #14
0
 def api(self):
     if self._api is None:
         self._api = PGoApi(provider=self.account.get('auth') or 'google',
                            username=self.account.get('user'),
                            password=self.account.get('pass'))
         if POKEHASH is not None:
             self._api.activate_hash_server(POKEHASH)
     return self._api
Example #15
0
    def login(self, subNumber, numActiveAtOnce):

        self.api = PGoApi()
        time.sleep(random.uniform(1, 2))
        #self.api.activate_signature(config.ENCRYPT_PATH)
        center = self.points[0]
        time.sleep(random.uniform(1, 2))
        self.api.set_position(center[0], center[1], 0)  # lat, lon, alt
        if hasattr(config, 'PROXIES') and config.PROXIES:
            time.sleep(random.uniform(1, 2))
            self.api.set_proxy(config.PROXIES)
        username, password, service = utils.get_worker_account(
            self.worker_no, subNumber, numActiveAtOnce)
        self.username = username
        self.subNumber = subNumber
        self.numActiveAtOnce = numActiveAtOnce
        while True:
            try:

                time.sleep(random.uniform(1, 2))
                self.api.set_authentication(
                    username=username,
                    password=password,
                    provider=service,
                )
                #if not loginsuccess:
                #    self.error_code = 'LOGINFAIL2'
                #    #self.restart()
                #    return False
            except pgoapi_exceptions.AuthException:
                logger.warning('Login failed!')
                self.error_code = 'LOGINFAIL1'
                #self.restart()
                return False
        #	continue
            except pgoapi_exceptions.NotLoggedInException:
                logger.error('Invalid credentials')
                self.error_code = 'BAD LOGIN'
                #self.restart()
                return False
                continue
            except pgoapi_exceptions.ServerBusyOrOfflineException:
                logger.info('Server too busy - restarting')
                self.error_code = 'BUSY'
                #self.restart()
                return False
            except pgoapi_exceptions.ServerSideRequestThrottlingException:
                logger.info('Server throttling - sleeping for a bit')
                time.sleep(random.uniform(1, 5))
                continue
            except Exception:
                logger.exception('A wild exception appeared!')
                self.error_code = 'EXCEPTION'
                #self.restart()
                #return
                continue
            break
        return True
Example #16
0
def perform_scout(p):
    global api, last_scout_timestamp, encounter_cache

    if not args.scout_account_username:
        return { "msg": "No scout account configured." }

    pokemon_name = get_pokemon_name(p.pokemon_id)

    # Check cache once in a non-blocking way
    if p.encounter_id in encounter_cache:
        result = encounter_cache[p.encounter_id]
        log.info(u"Cached scout-result: level {} {} with CP {}.".format(result["level"], pokemon_name, result["cp"]))
        return result

    scoutLock.acquire()
    try:
        # Check cache again after mutually exclusive access
        if p.encounter_id in encounter_cache:
            result = encounter_cache[p.encounter_id]
            log.info(u"Cached scout-result: level {} {} with CP {}.".format(result["level"], pokemon_name, result["cp"]))
            return result

        # Delay scouting
        now = time.time()
        if last_scout_timestamp is not None and now < last_scout_timestamp + scout_delay_seconds:
            wait_secs = last_scout_timestamp + scout_delay_seconds - now
            log.info("Waiting {} more seconds before next scout use.".format(wait_secs))
            time.sleep(wait_secs)

        log.info(u"Scouting a {} at {}, {}".format(pokemon_name, p.latitude, p.longitude))
        step_location = jitterLocation([p.latitude, p.longitude, 42])

        if api is None:
            # instantiate pgoapi
            api = PGoApi()

        api.set_position(*step_location)
        api.set_proxy({'http': args.scout_account_proxy, 'https': args.scout_account_proxy})
        account = {
            "auth_service": args.scout_account_auth,
            "username": args.scout_account_username,
            "password": args.scout_account_password,
        }
        check_login(args, account, api, None, False)

        if args.hash_key:
            key = key_scheduler.next()
            log.debug('Using key {} for this scout use.'.format(key))
            api.activate_hash_server(key)

        request_result = encounter_request(long(b64decode(p.encounter_id)), p.spawnpoint_id, p.latitude, p.longitude)

        # Update last timestamp
        last_scout_timestamp = time.time()
    finally:
        scoutLock.release()

    return parse_scout_result(request_result, p.encounter_id, pokemon_name)
Example #17
0
def make_api(user, passwd):
    api = PGoApi()

    # provide player position on the earth
    api.set_position(*default_position)

    if not api.login('ptc', user, passwd):
        return
    return api
Example #18
0
def accept_tos(username, password, lat, lon, alt, auth='ptc'):
    api = PGoApi()
    api.set_position(lat, lon, alt)
    api.login(auth, username, password)
    time.sleep(2)
    req = api.create_request()
    req.mark_tutorial_complete(tutorials_completed=0,
                               send_marketing_emails=False,
                               send_push_notifications=False)
    response = req.call()
    print('Accepted Terms of Service for {}'.format(username))
Example #19
0
    def init_api(self):
        self.logger.info("Initializing api...")
        self.api = PGoApi()

        self.api.login(self.config.auth,
                       self.config.username,
                       self.config.password,
                       self.config.latitude,
                       self.config.longitude,
                       10,
                       app_simulation=False)
Example #20
0
def accept_tos_helper(username, password, location):
    api = PGoApi()
    location = location.replace(" ", "")
    location = location.split(",")
    api.set_position(float(location[0]), float(location[1]), 0.0)
    api.login('ptc', username, password)
    time.sleep(1)
    req = api.create_request()
    req.mark_tutorial_complete(tutorials_completed = 0, send_marketing_emails = False, send_push_notifications = False)
    response = req.call()
    print('Accepted Terms of Service for {}'.format(username))
Example #21
0
    def setup_api(self):
        """Prepare and sign in to API"""
        self.api = PGoApi()

        if not self.api.login(self.config.auth_service,
                              str(self.config.username),
                              str(self.config.password)):
            print "Login error"
            exit(0)

        print "Signed in"
Example #22
0
def accept_tos(username, password):
    api = PGoApi()
    api.set_position(40.7127837, -74.005941, 0.0)
    api.login('ptc', username, password)
    time.sleep(2)
    req = api.create_request()
    req.mark_tutorial_complete(tutorials_completed=0,
                               send_marketing_emails=False,
                               send_push_notifications=False)
    response = req.call()
    print('Accepted Terms of Service for {}'.format(username))
Example #23
0
def checkAccounts():
    api = PGoApi()
    api.activate_hash_server('')
    bannedAccounts = []
    goodAccounts = []
    with open('accounts.json', 'r') as accountlist:
        accounts = json.load(accountlist)

    for account in accounts:
        print(f"Checking {account['username']}...")
        try:
            api.set_authentication(provider=account['type'],
                                   username=account['username'],
                                   password=account['password'])
            api.set_position(40.707259, -73.520977, 144.3)
            request = api.create_request()
            request.call(request)
            time.sleep(1)
            request = api.create_request()
            request.get_player(player_locale={
                'country': 'US',
                'language': 'en',
                'timezone': 'America/New_York'
            })
            request.call(request)
            time.sleep(1)
            request = api.create_request()
            request.download_remote_config_version(platform=1,
                                                   app_version=7903)
            request.check_challenge()
            request.get_hatched_eggs()
            request.get_inventory(last_timestamp_ms=0)
            request.check_awarded_badges()
            request.download_settings()
            resp = request.call(request)
            # print(resp)
            if not resp['responses'].get('GET_INVENTORY'):
                bannedAccounts.append(account)
                print("\rbanned.")
            else:
                goodAccounts.append(account)
                print("Good")
        except AuthException:
            bannedAccounts.append(account)
        time.sleep(10)

    print(
        f"found {len(bannedAccounts)} banned accounts and {len(goodAccounts)} unbanned accounts."
    )
    with open('banned.json', 'w') as bf:
        json.dump(bannedAccounts, bf)
    with open('good.json', 'w') as gf:
        json.dump(goodAccounts, gf)
Example #24
0
    def __init__(self, provider="google", username="", password=""):
        self._api = PGoApi()

        self.provider = provider
        self.username = username
        self.password = password

        self.current_position = (0, 0, 0)

        self.state = StateManager()

        self._pending_calls = {}
        self._pending_calls_keys = []
Example #25
0
    def setup_api(self):
        """Prepare and sign in to API"""
        self.api = PGoApi()
        self.get_location()

        if not self.api.login(self.config.auth_service,
                              str(self.config.username),
                              str(self.config.password), self.position[0],
                              self.position[1], self.position[2]):
            print "Login error"
            exit(0)

        print "Signed in"
def main():
    # log settings
    # log format
    logging.basicConfig(
        level=logging.DEBUG,
        format='%(asctime)s [%(module)10s] [%(levelname)5s] %(message)s')
    # log level for http request class
    logging.getLogger("requests").setLevel(logging.WARNING)
    # log level for main pgoapi class
    logging.getLogger("pgoapi").setLevel(logging.INFO)
    # log level for internal pgoapi class
    logging.getLogger("rpc_api").setLevel(logging.INFO)

    config = init_config()
    if not config:
        return

    if config.debug:
        logging.getLogger("requests").setLevel(logging.DEBUG)
        logging.getLogger("pgoapi").setLevel(logging.DEBUG)
        logging.getLogger("rpc_api").setLevel(logging.DEBUG)

    position = get_pos_by_name(config.location)
    if not position:
        return

    if config.test:
        return

    # instantiate pgoapi
    api = PGoApi()

    # provide player position on the earth
    api.set_position(*position)

    if not api.login(config.auth_service, config.username, config.password):
        return

    # chain subrequests (methods) into one RPC call

    # get player profile call
    # ----------------------
    response_dict = api.get_player()

    # apparently new dict has binary data in it, so formatting it with this method no longer works, pprint works here but there are other alternatives
    # print('Response dictionary: \n\r{}'.format(json.dumps(response_dict, indent=2)))
    print('Response dictionary: \n\r{}'.format(
        pprint.PrettyPrinter(indent=4).pformat(response_dict)))
    find_poi(api, position[0], position[1])
Example #27
0
def api_init(config):
    api = PGoApi()
    
    api.set_position(360,360,0)  
    api.set_authentication(provider = config.auth_service, username = config.username, password =  config.password)
    api.activate_signature(get_encryption_lib_path())
    api.get_player()
    time.sleep(1)
    response = api.get_inventory()
    if 'status_code' in response:
        if response['status_code'] == 1 or response['status_code'] == 2:
            return api
        elif response['status_code'] == 3:
            log.error('Account banned!'); return None
        else: return None
Example #28
0
 def setup_api(self):
     self.api = PGoApi()
     self.api.activate_hash_server(self.config.hash_key)
     self.get_location()
     print u'Signing in…'
     if not self.api.login(
             self.config.auth_service,
             self.config.username,
             self.config.password,
             self.position[0],  # latitude
             self.position[1],  # longitude
             self.position[2]  # altitude
     ):
         print 'Login error'
         exit(0)
Example #29
0
def accept_tos(username, password):
    flag = False
    while not flag:
        try:
            api = PGoApi()
            #Set spawn to NYC
            api.set_position(40.7127837, -74.005941, 0.0)
            api.login('ptc', username, password)
            time.sleep(0.5)
            req = api.create_request()
            req.mark_tutorial_complete(tutorials_completed = 0, send_marketing_emails = False, send_push_notifications = False)
            response = req.call()
            print('Accepted Terms of Service for {}'.format(username))
            flag = True
        except ServerSideRequestThrottlingException:
            print('This happens, just restart')
Example #30
0
    def _reset_api(self):
        self._api = PGoApi(device_info=self._generate_device_info())
        self._download_settings_hash = None
        self._asset_time = 0
        self._item_templates_time = 0

        # Timestamp when last API request was made
        self._last_request = 0

        # Timestamp of last get_map_objects request
        self._last_gmo = self._last_request

        # Timestamp for incremental inventory updates
        self._last_timestamp_ms = None

        # Timestamp when previous user action is completed
        self._last_action = 0