服务器上的Youtube身份验证异常

时间:2013-11-08 13:29:24

标签: authentication youtube

我必须在你管上访问上传的视频。在我正在验证的代码中,用户将访问该帐户。

var settings = new YouTubeRequestSettings("XYZ", "ABC",     
                  "xxx@gmail.com", "pwd");

var request = new YouTubeRequest(settings);

var service = new YouTubeService("XYZ");

service.setUserCredentials("xxx@gmail.com", "pwd");
var token = service.QueryClientLoginToken();
service.SetAuthenticationToken(token);

Uri uri = new Uri("http://gdata.youtube.com/feeds/api/users/default/uploads");
Feed<Video> videoFeed = request.Get<Video>(uri);

VideoUrlList = new List<VideoInformation>();
foreach (Video entry in videoFeed.Entries)
{
    VideoUrlList.Add(new VideoInformation
    {
        VideoId = entry.VideoId,
        VideoUrl = "http://www.youtube.com/embed/" + entry.VideoId
    });
}

我在本地环境中使用的代码运行良好。但是在服务器上产生身份验证异常的代码相同。

“服务器响应状态为500(内部服务器错误)”

任何机构都可以建议我如何解决这个问题吗? 提前致谢。

0 个答案:

没有答案