Пример #1
0
def get_location_forts(api, account, location):
    response = gmo(api, account, location)
    cells = response['responses']['GET_MAP_OBJECTS'].map_cells
    forts = []
    for i, cell in enumerate(cells):
        forts += cell.forts
    return forts
Пример #2
0
def get_location_forts(api, account, location):
    response = gmo(api, account, location)
    if len(response['responses']['CHECK_CHALLENGE'].challenge_url) > 1:
        log.error('account: %s got captcha: %s', account['username'],
                  response['responses']['CHECK_CHALLENGE'].challenge_url)
        return (ErrorType.captcha, None)
    cells = response['responses']['GET_MAP_OBJECTS'].map_cells
    forts = []
    for i, cell in enumerate(cells):
        forts += cell.forts
    if not forts:
        return (ErrorType.noStops, None)
    return (None, forts)
Пример #3
0
def get_location_forts(api, account, location):
    response = gmo(api, account, location)

    if len(response['responses']['CHECK_CHALLENGE'].challenge_url) > 1:
        log.error('account: %s got captcha: %s', account['username'],
                  response['responses']['CHECK_CHALLENGE'].challenge_url)
        return (ErrorType.captcha, None)

    cells = response['responses']['GET_MAP_OBJECTS'].map_cells
    forts = []

    for cell in cells:
        for fort in cell.forts:
            # Only use Pokestops.
            if fort.type == 1:
                forts.append(fort)

    if not forts:
        return (ErrorType.no_stops, None)

    return (None, forts)