我收到以下错误,我想在 YouTube 视频上发布所有评论。
所以基本上我正在传递视频 ID,我想获得与该视频相关的所有评论
Google.Apis.Requests.RequestError
权限不足 [403]错误[消息[权限不足]位置[-]原因[权限不足]域[全局]]
这是我的代码:
protected void btnGetVideoDesc_Click(object sender, EventArgs e)
{
string videoId = txtVideoID.Text;
YoutubeVideo video = new YoutubeVideo(videoId);
lblTitle.Text = video.title;
lblPublishedDate.Text = video.publishdate.ToShortDateString();
}
public class YoutubeVideo
{
public string id, title, description ;
public DateTime publishdate;
public YoutubeVideo(string id)
{
this.id = id;
YoutubeAPI.GetVideoInfo(this);
}
}
public class YoutubeAPI
{
private static YouTubeService ytService = Auth();
private static YouTubeService Auth()
{
UserCredential creds;
var service = new YouTubeService();
try
{ …Run Code Online (Sandbox Code Playgroud)