如何在没有Auth的情况下连接到YouTube API?

时间:2011-12-02 11:10:56

标签: c# .net youtube youtube-api

阅读official documentation我找到了这段代码:

YouTubeRequestSettings settings = 
  new YouTubeRequestSettings("example app", clientID, developerKey);
YouTubeRequest request = new YouTubeRequest(settings);

但它说If you do not specify authentication information when creating the YouTubeRequestSettings object, then you will only be able to use the YouTubeRequest object to perform operations that do not require authentication.

我不介意身份验证,但如果我尝试:

YouTubeRequestSettings settings = 
  new YouTubeRequestSettings("example app");

仍在等待developerKey,所以它不起作用。

如何在没有身份验证的情况下创建该对象?有没有办法这样做?

1 个答案:

答案 0 :(得分:1)

你试过......

YouTubeRequestSettings settings = 
  new YouTubeRequestSettings("example app","","");

构造函数中的字符串不可为空/可选,因此您无法正确实例化