Skip to main content

Documentation

OAuth.OAuthCaptions

Constructors

constructor

new OAuthCaptions(oauth)

Parameters

NameType
oauthOAuth

Defined in

oauth/captions.ts:12

Properties

oauth

oauth: OAuth

Defined in

oauth/captions.ts:12

Methods

deleteCaption

deleteCaption(id): Promise\<void>

Deletes a Caption track.

Parameters

NameTypeDescription
idstringThe ID of the caption track to delete.

Returns

Promise\<void>

Defined in

oauth/captions.ts:170


downloadCaption

downloadCaption(id, format?, language?): Promise\<Buffer>

Downloads a Caption track.

Parameters

NameTypeDescription
idstringThe ID of the caption track to download.
format?"sbv" | "scc" | "srt" | "ttml" | "vtt"The file format to download the track in.
language?stringThe language to download the track in.

Returns

Promise\<Buffer>

Defined in

oauth/captions.ts:145


getCaption

getCaption(videoResolvable, captionId): Promise\<Caption>

Get a Caption object from the URL, ID, or search query of its video and the ID of the caption.

Parameters

NameTypeDescription
videoResolvableVideoResolvableThe Title, URL, or ID of the video to get the caption from.
captionIdstringThe ID of the caption.

Returns

Promise\<Caption>

Defined in

oauth/captions.ts:20


getCaptions

getCaptions(videoResolvable): Promise\<Caption[]>

Gets the Captions of a Video. Used mostly internally with Video.fetchCaptions.

Parameters

NameTypeDescription
videoResolvableVideoResolvableThe Title, URL, or ID of the video to get the captions from.

Returns

Promise\<Caption[]>

Defined in

oauth/captions.ts:45


updateCaption

updateCaption(id, track?, draft?): Promise\<Caption>

Edits a Caption track.
If your request does not specify a value for a property that already has a value, the property's existing value will be deleted.

Parameters

NameTypeDefault valueDescription
idstringundefinedThe ID of the caption track to edit.
track?BufferundefinedThe caption track to upload.
draftbooleannullWhether or not the caption track is a draft. If it is, it isn't visible to users.

Returns

Promise\<Caption>

Defined in

oauth/captions.ts:101


uploadCaption

uploadCaption(videoResolvable, language, name, track, draft?): Promise\<Caption>

Uploads a Caption track for a Video.

Parameters

NameTypeDefault valueDescription
videoResolvableVideoResolvableundefinedThe video to add the caption track to.
languagestringundefinedThe language that the caption track is in.
namestringundefinedThe name of the caption track.
trackBufferundefinedThe caption track to upload.
draftbooleanfalseWhether or not the caption track is a draft. If it is, it isn't visible to users.

Returns

Promise\<Caption>

Defined in

oauth/captions.ts:69