Ejemplo n.º 1
0
        //BACKGROUND WORKER


        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            YoutubeConverter converter = new YoutubeConverter();

            this.ConvertTimer.Start();
            converter.convertURL(url, directory);
            // DownloadedSong.Text = songName;
            backgroundWorker1.ReportProgress(0);
        }
Ejemplo n.º 2
0
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
     playlistURL = PlaylistInput.Text;
     if (playlistURL.Contains("youtube") && playlistURL.Contains("list="))
     {
         valid = true;
         string[] youtubeURLs = ExtractLinkPlaylist(playlistURL);
         for (int i = 0; i < youtubeURLs.Length; i++)
         {
             status = 1;
             YoutubeConverter yc = new YoutubeConverter();
             yc.convertURL(youtubeURLs[i], directory);
             songName = getYoutubeName(youtubeURLs[i]);
             backgroundWorker1.ReportProgress(0);
         }
     }
     else
     {
         MessageBox.Show("Please enter a valid playlist URL", "Error");
         valid = false;
     }
 }