powered by
Uploads a timed caption file using YouTube's resumable media-upload protocol. The request requires OAuth 2.0 authorization.
upload_caption( file, video_id, caption_name, language = "en-US", is_draft = FALSE, on_behalf_of_content_owner = NULL, open_url = FALSE, ... )
A list containing the final HTTP response, parsed caption resource, and video URL.
Path to a caption file containing timing information.
YouTube video ID.
Name of the caption track. YouTube limits names to 150 characters.
BCP 47 language tag for the caption track.
Whether the caption track should remain a draft.
Optional YouTube content-owner ID. This is only available to authorized YouTube content partners.
Whether to open the video's YouTube URL after a successful upload.
Additional arguments passed to [httr::POST()] and [httr::PUT()].
<https://developers.google.com/youtube/v3/docs/captions/insert>
if (FALSE) { upload_caption( file = "captions.vtt", video_id = "dQw4w9WgXcQ", caption_name = "English" ) }
Run the code above in your browser using DataLab