Beispiel #1
0
 private void GetVideo_Click(object sender, RoutedEventArgs e)
 {
     DownloadList(new List <YoutubeEntry>(1)
     {
         YoutubeEntry.Create(_youtubeUrl.Uri)
     });
 }
Beispiel #2
0
        private void Browser_LoadCompleted(object sender, NavigationEventArgs e)
        {
            Url.Text = e.Uri.ToString();
            MixpanelTrack("Navigated", new { Url = e.Uri.ToString(), Guid = _settings.ApplicationConfiguration.Guid });
            _youtubeUrl = YoutubeUrl.Create(e.Uri);
            var doc = Browser.Document as IHTMLDocument3;;

            if (doc == null)
            {
                return;
            }
            var html = doc.documentElement.outerHTML;

            _youtubeEntry = YoutubeEntry.Create(e.Uri, html);
            Loading();
        }
 public bool FillDownloadLists(DownloadLists lists)
 {
     try {
         lists.Entries.Clear();
         var listsEntry = GetDownloadLists() ?? new DownloadEntry();
         if (listsEntry.List != null && listsEntry.List.Count > 0)
         {
             foreach (var itemList in listsEntry.List)
             {
                 var youtubeEntries = new List <YoutubeEntry>();
                 var mediaType      = itemList.MediaType;
                 Uri uri;
                 var youtubeListEntry =
                     YoutubeEntry.Create(Uri.TryCreate(itemList.Url, UriKind.Absolute, out uri) ? uri : null);
                 youtubeListEntry.Title = itemList.Title;
                 SetExecutionStatus(youtubeListEntry, itemList);
                 youtubeListEntry.ThumbnailUrl = itemList.ThumbnailUrl;
                 foreach (var item in itemList.List)
                 {
                     var youtubeEntry = YoutubeEntry.Create(new Uri(item.Url), youtubeListEntry);
                     youtubeEntry.ThumbnailUrl = item.ThumbnailUrl;
                     youtubeEntry.Title        = item.Title;
                     SetExecutionStatus(youtubeEntry, item);
                     youtubeEntries.Add(youtubeEntry);
                 }
                 if (youtubeEntries.Count > 0)
                 {
                     lists.SoftAdd(youtubeEntries, mediaType);
                 }
             }
         }
         return(true);
     }
     catch {
         return(false);
     }
 }
Beispiel #4
0
 private void GetList_Click(object sender, RoutedEventArgs e)
 {
     YoutubeEntry.Create(_youtubeUrl.Uri).GetEntries(DownloadList);
 }