YouTube

Scheduling a Premiere

WithVideo takes one upload result and WithVideos a set of them. WaitForProcessing sets how often YouTube is asked whether a video is done, in seconds, and never goes below ten however low a number it is given. ScheduleAt starts a background thread that polls each video and sets its premiere as soon as it is processed, taking a PremiereTime: In1Minute, In5Minutes, In10Minutes, In15Minutes, In30Minutes, In45Minutes or In1Hour for an offset from the moment that video became ready, or At for an absolute time. It returns immediately. WithOutputTo pipes progress into a TextBox or RichTextBox on a form, whose message loop keeps the process alive. WaitForCompletion blocks until the scheduling thread is done, which is what a console workflow needs so it does not exit first.

WARNING

The polling runs on a background thread. A console workflow that does not call WaitForCompletion, or a form that is not left open, ends before anything is scheduled.

Examples

GPAL Fluent: High-level fluent C# API

//The offset is relative to when each video finished processing, not to when ScheduleAt was called, so a set that processes at different times premieres at different times.

GPAL.YouTube

.WithCredentials(credentials)

.WithVideos(uploadResults)

.WaitForProcessing(60)

.ScheduleAt(PremiereTime.In30Minutes)

.WaitForCompletion();

💬 Ask GPAL