import base64


def get_real_room_id(room_encoded):
    """Get a real room ID from a base64 encoded room ID"""
    # I found this from a discussion with cisco
    # roomId car be different is you are comming from a different endpoint (US/EU)
    # This is maybe because of something hardcoded in hookbuster (cisco was not sure)
    # They said they would take a look
    try:
        room_decode = base64.decodebytes(bytes(room_encoded, 'utf-8')).decode("utf-8").split('/')[-1]
    except Exception:
        room_decode = None
    return room_decode