def create_tags(tags: list) -> list:
    """Prepares tags for a new upload. Keeps as many old tags as possible while adding a "nightcore" tag."""

    to_add = 'nightcore'
    # The total number of characters in YouTube video tags can't exceed 400.
    # We're adding the "nightcore" tag, so we'll only keep this many characters of the original tags.
    target_len = 400 - len(to_add)

    new_tags = []
    length = 0
    # Keep tags up until they can no longer fit within our target.
    for tag in tags:
        length += len(tag)
        if length < target_len:
            new_tags.append(tag)
        else:
            break

    new_tags.append(to_add)

    return new_tags