Skip to contents

Inserts a new resource into this collection.

Usage

yt_videos_insert(
  video_path,
  snippet = yt_schema_video_snippet(),
  localizations = list(),
  status = yt_schema_video_status(),
  recording_date = datetime(),
  client = yt_construct_client(),
  cache_disk = getOption("yt_cache_disk", FALSE),
  cache_key = getOption("yt_cache_key", NULL),
  token = NULL
)

Arguments

video_path

(character scalar) Path to a video file to upload.

snippet

Basic details about a video, including title, description, uploader, thumbnails and category. See yt_schema_video_snippet() for details.

localizations

A list of named localizations objects. The localizations object contains localized versions of the basic details about the video, such as its title and description. The name should be a valid language key, which is a BCP-47 language code. See yt_schema_video_localization() for details on the format for each localization.

status

Basic details about a video category, such as its localized title. See yt_schema_video_status() for details.

recording_date

(datetime scalar) The date and time when the video was recorded.

client

A YouTube OAuth client created with yt_construct_client().

cache_disk

Should the access token be cached on disk? This reduces the number of times that you need to re-authenticate at the cost of storing access credentials on disk. Cached tokens are encrypted and automatically deleted 30 days after creation.

cache_key

If you are authenticating with multiple users using the same client, use this key to differentiate between those users.

token

A YouTube API OAuth token, or the access_token string from such a token. We recommend that you instead supply a client, in which case an appropriate token will be located if possible.

Value

The id of the uploaded video.