我有这些获取 youtube 视频列表的代码片段 (razor / c#)。不过,我需要获取 viewcount 字段,我该如何获取呢?
XDocument xDoc = XDocument.Load("https://gdata.youtube.com/feeds/api/users/BBC/uploads");
XNamespace media = "http://search.yahoo.com/mrss/";
XNamespace yt = "http://gdata.youtube.com/schemas/2007";
var items = xDoc.Descendants(media + "group")
.Select(i=>new{
Title = i.Element(media + "title").Value,
Content = i.Element(media + "content").Attribute("url").Value,
Thumbnail = i.Element(media + "thumbnail").Attribute("url").Value,
Category = i.Element(media + "category").Value
})
.ToList();
var items2 = xDoc.Descendants(media + "group").Descendants(yt + "uploaded")
.Select(i=>new{
Uploaded = i.Element(yt + "uploaded").Value
})
.ToList();