youtubei.js / Clients / Studio
Class: Studio
Constructors
new Studio()
new Studio(
session
):Studio
Parameters
• session: Session
Returns
Defined in
Methods
updateVideoMetadata()
updateVideoMetadata(
video_id
,metadata
):Promise
<ApiResponse
>
Updates the metadata of a video.
Parameters
• video_id: string
• metadata: Partial
<object
>
Returns
Promise
<ApiResponse
>
Example
const videoId = 'abcdefg';
const thumbnail = fs.readFileSync('./my_awesome_thumbnail.jpg');
const response = await yt.studio.updateVideoMetadata(videoId, {
tags: [ 'astronomy', 'NASA', 'APOD' ],
title: 'Artemis Mission',
description: 'A nicely written description...',
category: 27,
license: 'creative_commons',
thumbnail,
// ...
});
Defined in
upload()
upload(
file
,metadata
):Promise
<ApiResponse
>
Uploads a video to YouTube.
Parameters
• file: BodyInit
• metadata: Partial
<object
> = {}
Returns
Promise
<ApiResponse
>
Example
const file = fs.readFileSync('./my_awesome_video.mp4');
const response = await yt.studio.upload(file.buffer, { title: 'Wow!' });