Skip to main content

OAuth

popyt


popyt / OAuth / OAuth

Class: OAuth

Defined in: oauth/index.ts:24

All methods requiring an OAuth access token. Use YouTube.oauth to access these methods.

Constructors

Constructor

new OAuth(youtube, request, upload): OAuth

Defined in: oauth/index.ts:57

Parameters

youtube

YouTube

The YouTube object to retrieve the token from.

request

Request

upload

Request

Returns

OAuth

Properties

captions

captions: OAuthCaptions

Defined in: oauth/index.ts:51

All OAuth methods related to captions.


channels

channels: OAuthChannels

Defined in: oauth/index.ts:46

All OAuth methods related to channels.


comments

comments: OAuthComments

Defined in: oauth/index.ts:30

All OAuth methods related to comments.


playlists

playlists: OAuthPlaylists

Defined in: oauth/index.ts:41

All OAuth methods related to playlists/playlist items.


videos

videos: OAuthVideos

Defined in: oauth/index.ts:35

All OAuth methods related to videos/video ratings.


youtube

youtube: YouTube

Defined in: oauth/index.ts:25

Methods

getMe()

getMe(parts?): Promise<Channel>

Defined in: oauth/index.ts:78

Gets the authorized user's Channel.

Parameters

parts?

ChannelParts

Returns

Promise<Channel>


getMyChannelSections()

getMyChannelSections(parts?): Promise<ChannelSection[]>

Defined in: oauth/index.ts:140

Gets the authorized user's ChannelSections.

Parameters

parts?

ChannelSectionParts

Returns

Promise<ChannelSection[]>


getMyPlaylists()

getMyPlaylists(pageOptions?, parts?): Promise<PaginatedResponse<Playlist>>

Defined in: oauth/index.ts:128

Gets the authorized user's Playlists.

Parameters

pageOptions?

PageOptions

The number of pages and maximum number of items per page. Fetches the maximum number of items allowed by the API per page by default.
Set pages to a value <=0 to fetch Fetches the maximum allowed by the API by default. Set to a value <=0 to fetch all.

parts?

PlaylistParts

Returns

Promise<PaginatedResponse<Playlist>>


getMySubscriptions()

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

Defined in: oauth/index.ts:111

Gets the authorized user's Subscriptions.

Parameters

pageOptions?

PageOptions

The number of pages and maximum number of items per page. Fetches the maximum number of items allowed by the API per page by default.
Set pages to a value <=0 to fetch Fetches the maximum allowed by the API by default. Set to a value <=0 to fetch all.

parts?

SubscriptionParts

Returns

Promise<PaginatedResponse<Subscription>>


getMyUploads()

getMyUploads(pageOptions?, parts?): Promise<PaginatedResponse<Video>>

Defined in: oauth/index.ts:94

Gets the authorized user's uploads.
These are partial Video objects, meaning they are missing some data. See the properties they include here. Use YouTube.getVideo(playlist.videos) to fetch the full objects while not spamming your quota like you would using a loop.

Parameters

pageOptions?

PageOptions

The number of pages and maximum number of items per page. Fetches the maximum number of items allowed by the API per page by default.
Set pages to a value <=0 to fetch all.

parts?

PlaylistItemParts

The parts of the videos to fetch.

Returns

Promise<PaginatedResponse<Video>>