private void GetPlaylistItems()
 {
     List.SelectionMode = ListViewSelectionMode.Multiple;
     _playlist = YoutubeEntry.Create(_youtubeUrl.Uri);
     _playlist.GetEntries(OnEntriesReady, OnYoutubeLoading);
 }
 private YoutubeEntry(YoutubeEntry parent = null)
 {
     Parent = parent;
     _settings = new MSYoutubeSettings( "MS.Youtube.Downloader", "AI39si76x-DO4bui7H1o0P6x8iLHPBvQ24exnPiM8McsJhVW_pnCWXOXAa1D8-ymj0Bm07XrtRqxBC7veH6flVIYM7krs36kQg" ) {AutoPaging = true, PageSize = 50};
 }
 public static YoutubeEntry Create(Uri uri, YoutubeEntry parent = null)
 {
     var entry =  new YoutubeEntry(parent) { Uri = uri };
     return entry;
 }
 public YoutubeEntry Clone()
 {
     var entry = new YoutubeEntry {
         Title = Title,
         BaseFolder = BaseFolder,
         Parent = Parent,
         Description = Description,
         DownloadFolder = DownloadFolder,
         ProviderFolder = ProviderFolder,
         MediaType = MediaType,
         ThumbnailUrl = ThumbnailUrl,
         Uri = Uri,
         VideoExtension = VideoExtension,
         VideoFolder = VideoFolder
     };
     if (ThumbnailUrls != null && ThumbnailUrls.Length > 0) {
         entry.ThumbnailUrls = new string[ThumbnailUrls.Length];
         for (var i = 0; i < ThumbnailUrls.Length; i++)
             entry.ThumbnailUrls[i] = ThumbnailUrls[i];
     }
     return entry;
 }
        private async void FillEntriesUser(EntriesReady onEntriesReady, MSYoutubeLoading onYoutubeLoading)
        {
            var youtubeUrl = YoutubeUrl;
            var request = new MSYoutubeRequest(_settings);
            var items = await request.GetAsync(YoutubeUrl, new Uri(String.Format("https://gdata.youtube.com/feeds/api/users/{0}/playlists?v=2", youtubeUrl.UserId)), onYoutubeLoading);
            if (items == null) return;
            Entries = new ObservableCollection<Feed>();

            try {
                if (!String.IsNullOrWhiteSpace(items.AuthorId)) {
                    var favoritesEntry = new YoutubeEntry(this) {
                        Title = "Favorite Videos",
                        Uri = new Uri("http://www.youtube.com/playlist?list=FL" + items.AuthorId),
                    };
                    Entries.Add(favoritesEntry);
                }
                foreach (var member in items.Entries) {
                    var entry = new YoutubeEntry(this) {
                        Title = member.Title,
                        Uri = member.Uri,
                        Description = member.Description
                    };
                    Entries.Add(entry);
                }
            }
            catch {
                Entries.Clear();
            }
            if (onEntriesReady != null) onEntriesReady(Entries);
        }
 private void UpdateStatus(DownloadState state, YoutubeEntry entry, double percentage)
 {
     DownloadState = state;
     Percentage = percentage;
     if (OnListDownloadStatusChange != null) OnListDownloadStatusChange(this, entry, DownloadState, Percentage);
 }