YouTube

CreatePlaylist makes a new playlist and answers a YouTubePlaylistResult holding its id and url. AddToPlaylist adds the targeted videos to the playlist whose id it is given, which is the call for videos already uploaded; to put a video in a playlist as it goes up, say WithPlaylist before Upload instead. WithVideoId names a video to look up and can be said more than once to look up several. WithSearchTerms searches the channel, taking either a query string or a grid, where the first column of every row is one search, so a grid runs a set of searches in one pass. The two GetResults overloads are not the same call. GetResults(out List) answers everything asked for, looking up any video ids and running any search terms. GetResults(out YouTubeVideoInfo) is a lookup only: it answers the video named by WithVideoId and does no searching at all.

GPAL Fluent: High-level fluent C# API

//The list overload is the general one and handles ids and searches together. The single overload only reads the video WithVideoId named, so a chain that sets search terms and calls it comes back with nothing. Searching runs against the channel the credentials belong to.

List<YouTubeVideoInfo> found;


// a search, or several at once from a grid

GPAL.YouTube

.WithCredentials(credentials)

.WithSearchTerms("bot of the week")

.GetResults(out found);


// one video by id, which is the single overload

GPAL.YouTube

.WithCredentials(credentials)

.WithVideoId(uploaded.VideoId)

.GetResults(out YouTubeVideoInfo info);


YouTubePlaylistResult playlist = GPAL.YouTube

.WithCredentials(credentials)

.WithTitle("Bot of the Week")

.CreatePlaylist();

💬 Ask GPAL