Skip to main content

ChannelSection

popyt


popyt / Library Exports / ChannelSection

Class: ChannelSection

Defined in: entities/channel-section.ts:8

A YouTube Channel section.

Constructors

Constructor

new ChannelSection(youtube, data, full?): ChannelSection

Defined in: entities/channel-section.ts:91

Parameters

youtube

YouTube

data

Schema$ChannelSection

full?

boolean = true

Returns

ChannelSection

Properties

channelId

channelId: string

Defined in: entities/channel-section.ts:52

The ID of the channel that created this channel section.


channelIds?

optional channelIds?: string[]

Defined in: entities/channel-section.ts:67

The IDs of the channels in this channel section. Undefined if there aren't any.


channels?

optional channels?: Channel[]

Defined in: entities/channel-section.ts:77

The channels in the channel section. Only available after calling ChannelSection.fetchChannels.


data

data: any

Defined in: entities/channel-section.ts:37

The raw data of this channel section.


full

full: boolean = true

Defined in: entities/channel-section.ts:32

Whether or not this a full channel section object.


id

id: string

Defined in: entities/channel-section.ts:89

The ID of this channel section.


name

name: string

Defined in: entities/channel-section.ts:42

The name of this channel section.


playlistIds?

optional playlistIds?: string[]

Defined in: entities/channel-section.ts:62

The IDs of the playlists in this channel section. Undefined if there aren't any.


playlists?

optional playlists?: Playlist[]

Defined in: entities/channel-section.ts:72

The playlists in the channel section. Only available after calling ChannelSection.fetchPlaylists.


position

position: number

Defined in: entities/channel-section.ts:57

The zero-based position of this channel section on the channel page.


subscriptions?

optional subscriptions?: PaginatedResponse<Subscription>

Defined in: entities/channel-section.ts:84

The subscriptions in the channel section.
Only valid if ChannelSection.type is subscriptions. Only available after calling ChannelSection.fetchChannels().


type

type: "subscriptions" | "likes" | "allplaylists" | "completedevents" | "likedplaylists" | "liveevents" | "multiplechannels" | "multipleplaylists" | "popularuploads" | "postedplaylists" | "postedvideos" | "recentactivity" | "recentposts" | "recentuploads" | "singleplaylist" | "upcomingevents"

Defined in: entities/channel-section.ts:47

The type of this channel section.


youtube

youtube: YouTube

Defined in: entities/channel-section.ts:27

The YouTube object that created this channel section object.


endpoint

static endpoint: string = 'channelSections'

Defined in: entities/channel-section.ts:12

The name of the endpoint used for this entity.


fields

static fields: string = 'items(kind,id,contentDetails,snippet)'

Defined in: entities/channel-section.ts:22

The fields to request for this entity.


part

static part: string = 'contentDetails,snippet'

Defined in: entities/channel-section.ts:17

The parts to request for this entity.

Methods

fetch()

fetch(parts?): Promise<ChannelSection>

Defined in: entities/channel-section.ts:125

Fetches this channel section from the API and reassigns this object to the new channel section object. Only useful if this.full is false, or if you want updated channel section info.

Parameters

parts?

ChannelSectionParts

Returns

Promise<ChannelSection>


fetchChannels()

fetchChannels(parts?): Promise<Channel[]>

Defined in: entities/channel-section.ts:150

Fetches the channel section's channels from the API and assigns them to the ChannelSection.channels property.

Parameters

parts?

ChannelParts

Returns

Promise<Channel[]>


fetchPlaylists()

fetchPlaylists(pageOptions?, parts?): Promise<Playlist[]>

Defined in: entities/channel-section.ts:133

Fetches the channel section's playlists from the API and assigns them to the ChannelSection.playlists property.

Parameters

pageOptions?

PageOptions

parts?

PlaylistParts

Returns

Promise<Playlist[]>


fetchSubscriptions()

fetchSubscriptions(pageOptions?, parts?): Promise<PaginatedResponse<Subscription>>

Defined in: entities/channel-section.ts:165

Parameters

pageOptions?

PageOptions

parts?

SubscriptionParts

Returns

Promise<PaginatedResponse<Subscription>>