Skip to main content

OAuthCaptions

popyt


popyt / OAuth / OAuthCaptions

Class: OAuthCaptions

Defined in: oauth/captions.ts:12

Constructors

Constructor

new OAuthCaptions(oauth, request, upload): OAuthCaptions

Defined in: oauth/captions.ts:16

Parameters

oauth

OAuth

request

Request

upload

Request

Returns

OAuthCaptions

Properties

oauth

oauth: OAuth

Defined in: oauth/captions.ts:16

Methods

deleteCaption()

deleteCaption(id): Promise<void>

Defined in: oauth/captions.ts:177

Deletes a Caption track.

Parameters

id

string

The ID of the caption track to delete.

Returns

Promise<void>


downloadCaption()

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

Defined in: oauth/captions.ts:152

Downloads a Caption track.

Parameters

id

string

The ID of the caption track to download.

format?

"sbv" | "scc" | "srt" | "ttml" | "vtt"

The file format to download the track in.

language?

string

The language to download the track in.

Returns

Promise<Buffer<ArrayBufferLike>>


getCaption()

getCaption(videoResolvable, captionId): Promise<Caption>

Defined in: oauth/captions.ts:27

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

Parameters

videoResolvable

VideoResolvable

The Title, URL, or ID of the video to get the caption from.

captionId

string

The ID of the caption.

Returns

Promise<Caption>


getCaptions()

getCaptions(videoResolvable): Promise<Caption[]>

Defined in: oauth/captions.ts:52

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

Parameters

videoResolvable

VideoResolvable

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

Returns

Promise<Caption[]>


updateCaption()

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

Defined in: oauth/captions.ts:108

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

id

string

The ID of the caption track to edit.

track?

Buffer

The caption track to upload.

draft?

boolean = null

Whether or not the caption track is a draft. If it is, it isn't visible to users.

Returns

Promise<Caption>


uploadCaption()

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

Defined in: oauth/captions.ts:76

Uploads a Caption track for a Video.

Parameters

videoResolvable

VideoResolvable

The video to add the caption track to.

language

string

The language that the caption track is in.

name

string

The name of the caption track.

track

Buffer

The caption track to upload.

draft?

boolean = false

Whether or not the caption track is a draft. If it is, it isn't visible to users.

Returns

Promise<Caption>