来自显示名称的youtube api获取用户名

时间:2014-02-21 09:49:03

标签: c# asp.net

我有来自youtube的显示名称。我如何获得用户名?

我的代码如下: -

 public static YouTubeVideoObject[] GetVideos(string User)
   {

           YouTubeRequestSettings settings =
           new YouTubeRequestSettings(User, YOUTUBE_DEVELOPER_KEY);
           YouTubeRequest request = new YouTubeRequest(settings);
           User = User.Replace(" ", "%20");
           string feedUrl = "http://gdata.youtube.com/feeds/api/videos?q=" + User + "&orderby=published";

           Feed<Video> videoFeed = request.Get<Video>(new Uri(feedUrl));
           return (from video in videoFeed.Entries
                   select new YouTubeVideoObject() { VideoId = video.VideoId, Title = video.Title, Description = video.Description }).ToArray();

   }

提前感谢。

0 个答案:

没有答案