Example #1
0
 //Run youtube-DL for single URL
 public static void DLS(string URL, string args)
 {
     if (Err.isNull(args) == true)
     {
         string argset = args + " " + URL;
         var    start  = new Process
         {
             StartInfo = new ProcessStartInfo
             {
                 FileName  = Form1.localP,
                 Arguments = argset
             }
         };
         start.Start();
         start.WaitForExit();
         Thread.Sleep(4000);
         //FileIO.cleaner();
     }
     else
     {
         MessageBox.Show("INPUT ERROR", "INPUT ERROR");
     }
 }
Example #2
0
        //Pass pars to DLMan for execution
        private void BDL_Click(object sender, EventArgs e)
        {
            int totalList = LBURLs.Items.Count;

            if (Err.isNull(LBURLs.Items.ToString()) == true && Err.isNull(DLType.DLT) == true)
            {
                if (totalList > 1)
                {
                    string[] LURL    = LBURLs.Items.OfType <string>().ToArray();
                    string   LDLType = DLType.DLT;
                    ListMan.initListA(LURL, LDLType);
                    DLMan.DLA(ListMan.URLA, ListMan.Args);
                    BSDL.Enabled = true;
                    //FileIO.cleaner();
                }
                else if (totalList == 1)
                {
                    string LURL    = LBURLs.Items[0].ToString();
                    string LDLType = DLType.DLT;
                    ListMan.initList(LURL, LDLType);
                    DLMan.DLS(ListMan.URL, ListMan.Args);
                    BSDL.Enabled = true;
                    //FileIO.cleaner();
                }
                //"It could never happen" is not an excuse to not be ready for it
                else if (totalList < 0)
                {
                    MessageBox.Show("LIST UNDERFLOW ERROR", "Input error");
                }
            }
            //Catch null list
            else
            {
                MessageBox.Show("One or more of your inputs does not exist", "Input Error");
            }
        }