Options
All
  • Public
  • Public/Protected
  • All
Menu

Class YouTubePlayList

YouTube Playlist Class containing vital informations about playlist.

Hierarchy

  • YouTubePlayList

Index

Constructors

Properties

__count: number

Total no of pages count.

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

Token containing API key, Token, ClientVersion.

Type declaration

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

YouTube Playlist channel data

fetched_videos: Map<string, YouTubeVideo[]>

Map contaning data of all fetched videos

id?: string

YouTube Playlist ID

lastUpdate?: string

Time when playlist was last updated

link?: string

YouTube Playlist url with starting video url.

thumbnail?: YouTubeThumbnail

YouTube Playlist thumbnail Data

title?: string

YouTube Playlist Name

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

YouTube Class type. == "playlist"

url?: string

YouTube Playlist url

videoCount?: number

Total no of videos in that playlist

videos?: YouTubeVideo[]

Videos array containing data of first 100 videos

views?: number

Total views of that playlist

Accessors

  • get total_pages(): number
  • get total_videos(): number
  • This tells total number 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

  • __patch(data: any): void
  • Updates variable according to a normal data.

    Parameters

    • data: any

      Json Parsed YouTube Playlist data

    Returns void

  • __patchSearch(data: any): void
  • Updates variable according to a searched data.

    Parameters

    • data: any

      Json Parsed YouTube Playlist data

    Returns void

  • Fetches remaining data from playlist

    For fetching and getting all songs data, see total_pages property.

    Parameters

    • max: number = Infinity

      Max no of videos to fetch

      Default = Infinity

    Returns Promise<YouTubePlayList>

  • Parses next segment of videos from playlist and returns parsed data.

    Parameters

    • limit: number = Infinity

      Total no of videos to parse.

      Default = Infinity

    Returns Promise<YouTubeVideo[]>

    Array of YouTube Video Class

  • YouTube Playlists are divided into pages.

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

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

    await playlist.fetch()

    const result = playlist.page(2)
    see

    YouTubePlayList.all_videos

    Parameters

    • number: number

      Page number

    Returns YouTubeVideo[]

    Array of YouTube Video Class

Generated using TypeDoc