Beispiel #1
0
def setup_pogo_account(args, status, account):
    pgacc = POGOAccount(account['auth_service'], account['username'],
                        account['password'])
    pgacc.cfg['player_locale'] = args.player_locale
    account['pgacc'] = pgacc

    # 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'])
        pgacc.proxy_url = status['proxy_url']

    return pgacc
Beispiel #2
0
def setup_mrmime_account(args, status, account):
    reset_account(account)
    pgacc = POGOAccount(account['auth_service'], account['username'],
                        account['password'])
    pgacc.cfg['player_locale'] = args.player_locale
    pgacc.callback_egg_hatched = log_hatched_egg

    # Initialize POGOAccount from PGPool info
    if 'pgpool_account' in account:
        pgacc.rareless_scans = account['pgpool_account'].get('rareless_scans',
                                                             0)
        pgacc.shadowbanned = account['pgpool_account'].get('shadowbanned',
                                                           False)
        del account['pgpool_account']

    account['pgacc'] = pgacc

    # 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'])
        pgacc.proxy_url = 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 pgacc
Beispiel #3
0
def captcha_solver_thread(args,
                          account_queue,
                          account_captchas,
                          hash_key,
                          wh_queue,
                          token=None):
    status, account, captcha_url = account_captchas.popleft()

    status['message'] = 'Waking up account {} to verify captcha token.'.format(
        account['username'])
    log.info(status['message'])

    pgacc = POGOAccount(account['auth_service'], account['username'],
                        account['password'])

    if hash_key:
        log.debug('Using key {} for solving this captcha.'.format(hash_key))
        pgacc.hash_key = hash_key

    if args.proxy:
        # Try to fetch a new proxy
        proxy_num, proxy_url = get_new_proxy(args)

        if proxy_url:
            log.debug('Using proxy %s', proxy_url)
            pgacc.proxy_url = proxy_url

    location = account['last_location']

    pgacc.set_position(location[0], location[1], location[2])
    pgacc.check_login()

    wh_message = {
        'status_name': args.status_name,
        'status': 'error',
        'mode': 'manual',
        'account': account['username'],
        'captcha': status['captcha'],
        'time': 0
    }
    if not token:
        token = token_request(args, status, captcha_url)
        wh_message['mode'] = '2captcha'

    verified = pgacc.req_verify_challenge(token)

    last_active = account['last_active']
    hold_time = (datetime.utcnow() - last_active).total_seconds()
    wh_message['time'] = int(hold_time)

    if verified:
        status['message'] = pgacc.last_msg + ", returning to active duty."
        account_revive(args, account_queue, account)
        wh_message['status'] = 'success'
    else:
        status['message'] = pgacc.last_msg + ", putting back in captcha queue."
        account_captchas.append((status, account, captcha_url))
        wh_message['status'] = 'failure'

    if args.webhooks:
        wh_queue.put(('captcha', wh_message))
    # Make sure status is updated
    time.sleep(1)