c# - 无需身份验证即可获取 youtube 视频

标签 c# asp.net youtube-api

如果没有开发人员 key ,您如何发出 YouTube 请求?

例如我有:

Uri videoEntryUrl = new Uri("http://gdata.youtube.com/feeds/api/videos/xyz123");
Video video = request.Retrieve<Video>(videoEntryUrl);

我想要视频对象,但请求对象需要凭据等 - 有办法解决这个问题吗?

documentation确实说:

Read-only requests to retrieve public videos do not require authentication.

最佳答案

使用空值初始化您的 YouTubeRequestSettings:

YouTubeRequestSettings settings = new YouTubeRequestSettings(null, null);
YouTubeRequest request = new YouTubeRequest(settings);
Uri videoEntryUrl = new Uri("http://gdata.youtube.com/feeds/api/videos/xyz123");
Video video = request.Retrieve<Video>(videoEntryUrl);

关于c# - 无需身份验证即可获取 youtube 视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8953970/

相关文章:

c# - 如何从 ContentPage 获取应用版本?

c# - Linq-to-sql 查询中的动态类型

javascript - AJAX 成功 (ASP.NET MVC) 上的关闭模式

c# - 在 gridview 中使用 PAGING 为 FILTER 实现正确逻辑的方法

youtube - 显示所有基于标签的YouTube视频

android - jquery mobile + phonegap 构建中的 Youtube iframe

c# - 自动实现属性中的私有(private)变量在哪里/什么?

c# - 如何从 C# 应用程序创建注册表项?

c# - 在 ASPX 脚本 block 中声明一个类然后将其存储在 session 中

parse-platform - 以最轻微的负载达到 YouTube API 服务限制