@sushibtw/youtubei
Version:
Simple package to get information from youtube such as videos, playlists, channels, video information & comments, related videos, up next video, and more!
40 lines (39 loc) • 1.27 kB
TypeScript
import { Thumbnails, BaseAttributes, Base, Playlist } from ".";
import { YoutubeRawData } from "../common";
import Channel from "./Channel";
/** @hidden */
interface PlaylistCompactAttributes extends BaseAttributes {
title: string;
thumbnails: Thumbnails;
channel?: Channel;
videoCount: number;
}
/** Represents a Compact Playlist (e.g. from search result, upNext / related of a video) */
export default class PlaylistCompact extends Base implements PlaylistCompactAttributes {
/** The playlist's title */
title: string;
/** Thumbnails of the playlist with different sizes */
thumbnails: Thumbnails;
/** The channel that made this playlist */
channel?: Channel;
/** How many videos in this playlist */
videoCount: number;
/** @hidden */
constructor(playlist?: Partial<PlaylistCompactAttributes>);
/**
* Load this instance with raw data from Youtube
*
* @hidden
*/
load(data: YoutubeRawData): PlaylistCompact;
/**
* Get {@link Playlist} object based on current playlist id
*
* Equivalent to
* ```js
* client.getPlaylist(playlistCompact.id);
* ```
*/
getPlaylist(): Promise<Playlist | undefined>;
}
export {};