private IEnumerable <Comment> GetComments(string videoId) { foreach (var commentThread in _commentThreadIterator.GetCommentThreads("snippet,replies", videoId)) { // Get the top comment yield return(commentThread.Snippet.TopLevelComment); // Finally get the rest of the comment in the comment thread foreach (var comment in _commentIterator.GetComments("snippet", commentThread.Id, CommentsResource.ListRequest.TextFormatEnum.PlainText)) { yield return(comment); } } }
public void Init(string videoId, string part) { _commentThreadEnumerator = _commentThreadIterator.GetCommentThreads(part, videoId).GetEnumerator(); }