Options
All
  • Public
  • Public/Protected
  • All
Menu

YouTube Playlist Class containing vital informations about playlist.

Hierarchy

  • YouTubePlayList

Index

Constructors

constructor

Properties

Private __count

__count: number

Total no of pages count.

Private _continuation

_continuation: { api?: string; clientVersion?: string; token?: string } = {}

Token containing API key, Token, ClientVersion.

Type declaration

  • Optional api?: string
  • Optional clientVersion?: string
  • Optional token?: string

Optional channel

channel?: YouTubeChannel

YouTube Playlist channel data

Private fetched_videos

fetched_videos: <internal>.Map<string, YouTubeVideo[]>

Map contaning data of all fetched videos

Optional id

id?: string

YouTube Playlist ID

Optional lastUpdate

lastUpdate?: string

Time when playlist was last updated

Optional link

link?: string

YouTube Playlist url with starting video url.

Optional thumbnail

thumbnail?: YouTubeThumbnail

YouTube Playlist thumbnail Data

Optional title

title?: string

YouTube Playlist Name

type

type: "playlist" | "channel" | "video"

YouTube Class type. == "playlist"

Optional url

url?: string

YouTube Playlist url

Optional videoCount

videoCount?: number

Total no of videos in that playlist

Private Optional videos

videos?: YouTubeVideo[]

Videos array containing data of first 100 videos

Optional views

views?: number

Total views of that playlist

Accessors

total_pages

  • get total_pages(): number
  • Gets total no of pages in that playlist class.

    For getting all songs in a playlist

    const playlist = play.playlist_info('playlist url');

    await playlist.fetch();

    let result = [];

    for (let i = 0; i <= playlist.total_pages;i++) {
    result.push(playlist.page(i));
    }

    Returns number

total_videos

  • get total_videos(): number
  • This tells total no of videos that have been fetched so far.

    This can be equal to videosCount if all videos in playlist have been fetched and they are not hidden.

    Returns number

Methods

Private __patch

  • __patch(data: any): void

Private __patchSearch

  • __patchSearch(data: any): void

fetch

next

page

  • YouTube Playlist is divided into pages.

    For example, if you want to get 101 - 200 songs

    const playlist = play.playlist_info('playlist url')

    await playlist.fetch()

    const result = playlist.page(2)

    Parameters

    • number: number

      Page number

    Returns YouTubeVideo[]

    Array of YouTube Video Class

toJSON

Generated using TypeDoc