Ejemplo n.º 1
0
        public void SearchVideo()
        {
            lv_vdata.Items.Clear();
            IDsVideo.Clear();
            Search search;

            if (tb_vsearch.Text.StartsWith("playlist:"))
                search = new Search(tb_vsearch.Text.Replace("playlist:", ""), Search.SearchType.PlaylistVideos);
            else
                search = new Search(tb_vsearch.Text, Search.SearchType.Video);

            IDsVideo.AddRange(search.GetUrl());
            foreach (ListViewItem l in search.BuildResult())
                lv_vdata.Items.Add(l);
        }
Ejemplo n.º 2
0
        public void SearchPlaylist()
        {
            lv_pdata.Items.Clear();
            IDsPlaylist.Clear();

            Search search = new Search(tb_psearch.Text, Search.SearchType.Playlist);
            IDsPlaylist.AddRange(search.GetUrl());
            foreach (ListViewItem l in search.BuildResult())
                lv_pdata.Items.Add(l);
        }
Ejemplo n.º 3
0
 public void AddPlaylistToQueue(AV type)
 {
     if (CurrentPlaylistID != "")
     {
         Search search = new Search(CurrentPlaylistID, Search.SearchType.PlaylistVideos);
         List<string> url = search.GetUrl();
         List<string> title = search.GetTitle();
         List<string> views = search.GetViews();
         List<string> length = search.GetLength();
         for (int i = 0; i < url.Count; i++)
         {
             if (!QueueContains(title[i], type))
                 AddToQueue(title[i], url[i], views[i], length[i], type);
         }
     }
 }
Ejemplo n.º 4
0
        public void SearchVideo()
        {
            as_video.Items.Clear();
            lv_vdata.Items.Clear();
            IDsVideo.Clear();
            OrderVideo.Clear();
            Search search;

            search = new Search(tb_vsearch.Text, Search.SearchType.Video);

            IDsVideo.AddRange(search.GetUrl());
            for (int i = 0; i < IDsVideo.Count; i++) OrderVideo.Add(i);
            foreach (ListViewItem l in search.BuildResult())
                lv_vdata.Items.Add(l);
        }
Ejemplo n.º 5
0
        public void SearchPlaylistVideo(string playlistID)
        {
            as_playlist.Items.Clear();
            lv_pvdata.Items.Clear();
            IDsPlaylistVideo.Clear();
            OrderPlaylistVideo.Clear();
            Search search;

            search = new Search(playlistID, Search.SearchType.PlaylistVideos);

            IDsPlaylistVideo.AddRange(search.GetUrl());
            for (int i = 0; i < IDsPlaylistVideo.Count - 1; i++) OrderPlaylistVideo.Add(i);
            foreach (ListViewItem l in search.BuildResult())
                lv_pvdata.Items.Add(l);
            lv_pvdata.Items[0].Selected = true;
        }
Ejemplo n.º 6
0
 public void AddPlaylistToQueue(AV type)
 {
     if (CurrentPlaylistID != "")
     {
         Search search = new Search(CurrentPlaylistID, Search.SearchType.PlaylistVideos);
         List<string> url = search.GetUrl();
         List<string> title = search.GetTitle();
         List<string> views = search.GetViews();
         List<string> length = search.GetLength();
         if (CurrentPlaylistVideoB64URL == "")
         {
             for (int i = 1; i < url.Count; i++)
             {
                 if (!QueueContains(title[i], type))
                     AddToQueue(title[i], url[i], views[i], length[i], type);
             }
         }
         else
         {
             int i = lv_pvdata.SelectedIndices[0];
             if (QueueContains(lv_pvdata.Items[i].Text, type))
             {
                 MessageBox.Show("You are already downloading a video of the same name!", "Whoops :P");
             }
             else
             {
                 AddToQueue(lv_pvdata.Items[i].Text, IDsPlaylistVideo[i], lv_pvdata.Items[i].SubItems[1].Text,
                     lv_pvdata.Items[i].SubItems[2].Text, type);
             }
         }
     }
 }