【问题标题】:How can I connect to YouTube API without Auth?如何在没有身份验证的情况下连接到 YouTube API?
【发布时间】:2012-01-11 10:20:03
【问题描述】:

阅读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,所以它不起作用。

如何在没有身份验证的情况下创建该对象?有什么方法可以做到吗?

【问题讨论】:

    标签: c# .net youtube youtube-api


    【解决方案1】:

    你试过了吗……

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

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

    【讨论】:

    • 是的,但它不起作用。我看到需要开发人员密钥!我真的不喜欢这种行为......
    猜你喜欢
    • 2012-02-18
    • 2017-10-24
    • 1970-01-01
    • 1970-01-01
    • 2018-10-06
    • 2022-06-12
    • 2018-09-28
    • 2022-09-23
    • 1970-01-01
    相关资源
    最近更新 更多