Skip to main content

Documentation

OAuth.OAuthCaptions

Constructors

constructor

new OAuthCaptions(oauth)

Parameters

NameType
oauthOAuth

Defined in

oauth/captions.ts:10

Properties

oauth

oauth: OAuth

Defined in

oauth/captions.ts:10

Methods

deleteCaption

deleteCaption(id): Promise<void>

Deletes a Caption track.
Last tested 06/11/2020 04:50. PASSING

Parameters

NameTypeDescription
idstringThe ID of the caption track to delete.

Returns

Promise<void>

Defined in

oauth/captions.ts:166


downloadCaption

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

Downloads a Caption track.
Last tested 06/11/2020 04:50. PASSING

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:142


getCaption

getCaption(videoResolvable, captionId): Promise<Caption>

Get a Caption object from the ID of the caption.
Last tested 06/11/2020 04:50. PASSING

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:18


getCaptions

getCaptions(videoResolvable): Promise<Caption[]>

Gets the Captions of a Video. Used mostly internally with Video.fetchCaptions.
Last tested 06/11/2020 04:50. PASSING

Parameters

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

Returns

Promise<Caption[]>

Defined in

oauth/captions.ts:39


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.
Last tested 06/11/2020 04:50. PASSING

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:97


uploadCaption

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

Uploads a Caption track for a Video.
Last tested 06/11/2020 04:50. PASSING

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:64