2015-05-11 53 views
0

我有一个应用程序正在收集youtube用户的视频。 因为3天,停止,而不是gatehring视频和列表视图中唯一的一个视频显示YouTube网址:“https://www.youtube.com/devicesupportYoutube Gdata用户供稿停止工作

我已阅读,网址,但仍然不明白为什么它不工作。如果有人遇到同样的问题,我会很乐意帮助我。 我的代码:

private void Get_Video_Of_Searched_User() 
    { 
     using (new CWaitCursor()) 
     { 
      int TotalVideoFound = 0; 
      string VideoID = string.Empty; 
      string YouTube_User = this.Txt_Youtube_UserName.Text; 

      int StartIndex = (Current_Page * 50) + 1; 

      YouTubeService ytsService = new YouTubeService(strAppName, strKey); 
      Uri urlEntryUrl = default(Uri); 
      urlEntryUrl = new Uri("https://gdata.youtube.com/feeds/api/users/" + YouTube_User + "/uploads?&max-results=50&start-index=" + StartIndex.ToString() + ""); 


      FeedQuery fqResults = new FeedQuery(); 
      fqResults.Uri = urlEntryUrl; 
      Feed<Video> vidFeed = new Feed<Video>(ytsService, fqResults); 

      try 
      { 
       TotalVideoFound = vidFeed.TotalResults; 
      } 
      catch 
      { 
       MessageBox.Show("Incorrect Username."); 
       return; 
      } 

      if (StartIndex == 1) 
       Lbl_TotalVideos.Text = "Total Videos: (" + TotalVideoFound.ToString() + ")"; 

      Enable_Disable_Next_And_Previous_Buttons(TotalVideoFound); 
      SortedDictionary<string, string> ListViewItems = new SortedDictionary<string, string>(); 

      Dict_User_Links_With_Title.Clear(); 
      foreach (Video vidEntry in vidFeed.Entries) 
      { 
       if (ListViewItems.ContainsKey(vidEntry.Title) == true) continue; 
       ListViewItems.Add(vidEntry.Title, vidEntry.ViewCount.ToString()); 
       VideoID = vidEntry.Id; 
       if (!Dict_User_Links_With_Title.ContainsKey(VideoID.Substring(VideoID.LastIndexOf(":") + 1))) 
        Dict_User_Links_With_Title.Add(VideoID.Substring(VideoID.LastIndexOf(":") + 1), vidEntry.Title); 
      } 

      ListView_User_Video_Links.Items.Clear(); 

      string[] MyListItems = new string[2]; 
      foreach (KeyValuePair<string, string> entry in ListViewItems) 
      { 
       MyListItems[0] = entry.Key; 
       MyListItems[1] = entry.Value; 
       ListView_User_Video_Links.Items.Add(new ListViewItem(MyListItems)); 
      } 

      string TotalViews = Get_Youtube_User_Total_Views(YouTube_User); 
      this.Total_Views_For_User.Text = "Total Views: (" + TotalViews + ")"; 

     } 
    } 

回答

0

YouTube数据API第3版具有这样您注册API密钥在谷歌API控制台中列出具体的配额数。您可以每天使用30,000单位/秒/用户和50,000,000。 如果您达到限制,Google将停止返回结果,直到您的配额被重置。

+0

嗨,我从来没有打过这么多的要求,所以现在正在调试所以最大的100个要求。所以你建议? – Jane1990