我最终通过反复试验弄清楚了这一点 - 脱节的 Youtube API 文档确实没有帮助!
AuthSub 已被弃用,如果您遇到获取 OAuth2 密钥的麻烦(文档中对此进行了很好的描述),您可以使用它上传视频。
为此,只需使用 access_token 代替 'YoutubeRequestSettings' 对象中的 authsub 键 - 如下例所示:
string myDeveloperKey = "Your developer key here";
string myOAuthKey = "The OAuth key for the target user's account here";
YouTubeRequestSettings settings = new YouTubeRequestSettings("My Uploader App Name", myDeveloperKey, myOAuthKey); // The documentation for this method implies it only accepts an authSub key - it works if you pass your OAuth key
YouTubeRequest request = new YouTubeRequest(settings);
Video newVideo = new Video();
newVideo.Title = "Test Video - ignore me";
newVideo.Tags.Add(new MediaCategory("Autos", YouTubeNameTable.CategorySchema));
newVideo.Keywords = "test 1 , test 2";
newVideo.Description = "test 3 test 4";
newVideo.YouTubeEntry.Private = false;
newVideo.Tags.Add(new MediaCategory("tag 1, tag 2", YouTubeNameTable.DeveloperTagSchema));
newVideo.Private = true; // Make this video private as it's a test
newVideo.YouTubeEntry.Location = new GeoRssWhere(37, -122);
newVideo.YouTubeEntry.MediaSource = new MediaFileSource(@"C:\MyTestVideo.mov", "video/quicktime");
Video createdVideo = request.Upload(newVideo);