【发布时间】:2017-05-10 19:06:40
【问题描述】:
我想尝试获取 youtube 直播 id。但我不能得到这个。 这是我的代码:
UserCredential credential;
Response.Write("AAA");
var stream2 = new FileStream("c:/users/gislap/documents/visual studio 2012/Projects/youtube/secrect.json", FileMode.Open, FileAccess.Read);
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream2).Secrets,
new[] { YouTubeService.Scope.Youtube },
"user",
CancellationToken.None,
new FileDataStore(this.GetType().ToString())
);
Response.Write("DDD");
var youtubeService = new YouTubeService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = this.GetType().ToString()
});
var my_video_request = youtubeService.LiveBroadcasts.ToString();
Label1.Text = my_video_request.ToString();
或者有什么方法可以获取所有视频列表?
【问题讨论】:
标签: c# youtube-api