我使用https://developers.google.com/youtube/v3/code_samples/dotnet#retrieve_my_uploads作为框架,并尝试更改每个视频的说明。我改变了两部分
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
// This OAuth 2.0 access scope allows for read-only access to the authenticated
// user's account, but not other types of account access.
new[] { YouTubeService.Scope.YoutubeForceSsl },
"user",
CancellationToken.None,
new FileDataStore(this.GetType().ToString())
);
和
foreach (var playlistItem in playlistItemsListResponse.Items)
{
if (playlistItem.Snippet.Description.Contains("something"))
{
Console.WriteLine("{0} ({1})", playlistItem.Snippet.Title, playlistItem.Snippet.Description);
Video video = new Video();
VideoSnippet snippet = new VideoSnippet();
VideoStatus status = new VideoStatus();
snippet.Description = "new string";
video.Snippet = snippet;
video.Status = status;
var videosUpdateRequest = youtubeService.Videos.Update(video, "snippet,status");
Video response = videosUpdateRequest.Execute();
}
}
但是我得到了
Error: Google.Apis.Requests.RequestError
Forbidden [403]
Errors [
Message[Forbidden] Location[ - ] Reason[forbidden] Domain[youtube.video]
]
我该如何解决这个问题?