当前位置: 首页>>代码示例>>C#>>正文


C# YouTubeRequest.GetPlaylistsFeed方法代码示例

本文整理汇总了C#中YouTubeRequest.GetPlaylistsFeed方法的典型用法代码示例。如果您正苦于以下问题:C# YouTubeRequest.GetPlaylistsFeed方法的具体用法?C# YouTubeRequest.GetPlaylistsFeed怎么用?C# YouTubeRequest.GetPlaylistsFeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在YouTubeRequest的用法示例。


在下文中一共展示了YouTubeRequest.GetPlaylistsFeed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        static void Main(string[] args)
        {
            YouTubeRequest request = new YouTubeRequest(new YouTubeRequestSettings(AppName, DevKey));

            var playlists = request.GetPlaylistsFeed("QualityCartoons");

            foreach (var playlistItem in playlists.Entries)
            {
                LoadPlaylist(request, playlistItem);
                //var query = new YouTubeQuery(YouTubeQuery.DefaultVideoUri);
                //query.Author = "QualityCartoons";
                //query.SafeSearch = YouTubeQuery.SafeSearchValues.None;

                //Feed<Video> videoFeed = request.Get<Video>(query);
            }

            Console.ReadKey(true);
        }
开发者ID:asharism,项目名称:DownTube,代码行数:18,代码来源:Program.cs

示例2: YouTubePlaylistRequestTest

        /////////////////////////////////////////////////////////////////////////////
        // 

        //////////////////////////////////////////////////////////////////////
        /// <summary>runs a test on the YouTube factory object</summary> 
        //////////////////////////////////////////////////////////////////////
        [Test] public void YouTubePlaylistRequestTest()
        {
            Tracing.TraceMsg("Entering YouTubePlaylistRequestTest");

            YouTubeRequestSettings settings = new YouTubeRequestSettings("NETUnittests", this.ytClient, this.ytDevKey, this.ytUser, this.ytPwd);

            YouTubeRequest f = new YouTubeRequest(settings);
            // GetVideoFeed get's you a users video feed
            Feed<Playlist> feed = f.GetPlaylistsFeed(null);

              // this will get you just the first 25 videos. 
            foreach (Playlist p in feed.Entries)
            {
                Assert.IsTrue(p.AtomEntry != null);
                Assert.IsTrue(p.Title != null);
                Feed<PlayListMember> list = f.GetPlaylist(p);
                foreach (PlayListMember v in list.Entries)
                {
                    Assert.IsTrue(v.AtomEntry != null, "There should be an atomentry");
                    Assert.IsTrue(v.Title != null, "There should be a title");
                    Assert.IsTrue(v.VideoId != null, "There should be a videoID"); 
                    // there might be no watchpage (not published yet)
                    // Assert.IsTrue(v.WatchPage != null, "There should be a watchpage");

        
                }
            }

           
	

        }
开发者ID:yodiz,项目名称:Avega.ContactSynchronizer,代码行数:38,代码来源:youtubetest.cs

示例3: YouTubePlaylistBatchTest

        public void YouTubePlaylistBatchTest()
        {
            Tracing.TraceMsg("Entering YouTubePlaylistBatchTest");

            YouTubeRequestSettings settings = new YouTubeRequestSettings("NETUnittests", this.ytClient, this.ytDevKey, this.ytUser, this.ytPwd);

            YouTubeRequest f = new YouTubeRequest(settings);
            // GetVideoFeed get's you a users video feed
            Feed<Playlist> feed = f.GetPlaylistsFeed(null);
            // this will get you just the first 25 playlists. 

            List<Playlist> list = new List<Playlist>();
            int i = 0; 
            foreach (Playlist p in feed.Entries)
            {
                list.Add(p);        // add everything you want to do here... 
            }

            Feed<PlayListMember> videos = f.GetPlaylist(list[0]);

            List<PlayListMember> lvideo = new List<PlayListMember>();

            foreach (PlayListMember v in videos.Entries)
            {
                lvideo.Add(v);        // add everything you want to do here... 
            }

            List<PlayListMember> batch = new List<PlayListMember>();

            PlayListMember toBatch = new PlayListMember();
            toBatch.Id = lvideo[1].Id;
            toBatch.VideoId = lvideo[1].VideoId;
            toBatch.BatchData = new GDataBatchEntryData();
            toBatch.BatchData.Id = "NEWGUY";
            toBatch.BatchData.Type = GDataBatchOperationType.insert;
            batch.Add(toBatch);

            toBatch = lvideo[1];
            toBatch.BatchData = new GDataBatchEntryData();
            toBatch.BatchData.Id = "DELETEGUY";
            toBatch.BatchData.Type = GDataBatchOperationType.delete;
            batch.Add(toBatch);

            toBatch = lvideo[0];
            toBatch.Position = 1; 
            toBatch.BatchData = new GDataBatchEntryData();
            toBatch.BatchData.Id = "UPDATEGUY";
            toBatch.BatchData.Type = GDataBatchOperationType.update;
            batch.Add(toBatch);


            Feed<PlayListMember> updatedVideos = f.Batch(batch, videos);

            foreach (Video v in updatedVideos.Entries)
            {
                Assert.IsTrue(v.BatchData.Status.Code < 300, "one batch operation failed: " + v.BatchData.Status.Reason);
            }
        }
开发者ID:yodiz,项目名称:Avega.ContactSynchronizer,代码行数:58,代码来源:youtubetest.cs

示例4: button5_Click

 //http://gdata.youtube.com/feeds/api/playlists/6B4AA5F8DE307567?v=2
 private void button5_Click(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(textBox3.Text))
     {
         YouTubeRequest request = new YouTubeRequest(settings);
         Feed<Playlist> userPlaylists = request.GetPlaylistsFeed(textBox3.Text);
         foreach (Playlist pl in userPlaylists.Entries)
         {
             temp = pl.Id.Split(':');
             cmbSubService.Items.Add(pl.Title);
         }
     }
 }
开发者ID:Gigawiz,项目名称:RipLeech,代码行数:14,代码来源:youtube.cs


注:本文中的YouTubeRequest.GetPlaylistsFeed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。