var credentials = new GDataCredentials(userName, password); var service = new YouTubeService(applicationName, developerKey) {Credentials = credentials}; var entry = new AtomEntry {Title = {Text = playlistName}}; entry = service.Insert(new Uri(YouTubeQuery.CreatePlaylistsUri(null)), entry); var id = ((XmlExtension) entry.FindExtension("playlistId", YouTubeNameTable.NSYouTube)).Node.InnerText; var batchUri = new Uri(string.Format("https://gdata.youtube.com/feeds/api/playlists/{0}/batch", id)); var query = new YouTubeQuery(YouTubeQuery.CreateUserUri(sourceUser)) {StartIndex = 1}; AtomFeed feed; do { feed = service.Query(query); service.Batch(feed, batchUri); query.StartIndex += feed.Entries.Count; } while (query.StartIndex < feed.TotalResults);Google Data API .NET client library
Friday, January 20, 2012
Create a YouTube playlist containing all the uploads of a given user
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment