public Output_Designer(string code) { InitializeComponent(); ol = OutputLocation.CreateFromString(code); tb_path.Text = ol.Path; if (ol.Type == OutputLocation.OutputType.File_Location) { rb_folder.Checked = true; } else { rb_ftp.Checked = true; gb_login.Visible = true; try { tb_pass.Text = ol.creds.Password; tb_user.Text = ol.creds.UserName; } catch { } } }
void DoConvert(object sender, EventArgs e) { int intCode = 0; if (rb_youtube.Checked) { switch (cb_singleType.SelectedItem.ToString()) { case "Audio": intCode = 0; break; case "Video": intCode = 1; break; case "Mixed": intCode = 2; break; } List <OutputLocation> ols = new List <OutputLocation>(); foreach (string code in listBox2.Items) { ols.Add(OutputLocation.CreateFromString(code)); } GetMediaFromYoutube(l_youtubepath.Text, intCode, ols.ToArray()); } else { //Load YPS File try { BinaryFormatter bin = new BinaryFormatter(); using (FileStream s = File.OpenRead(l_filepath.Text)) { List <InputSource> fileSorces = bin.Deserialize(s) as List <InputSource>; foreach (InputSource source in fileSorces) { int typeCode = 0; List <OutputLocation> ols = new List <OutputLocation>(); foreach (string code in listBox2.Items) { ols.Add(OutputLocation.CreateFromString(code)); } //Get typeCode from source enum switch (source.ExportAs) { case InputSource.SaveType.Audio: typeCode = 0; break; case InputSource.SaveType.Video: typeCode = 1; break; case InputSource.SaveType.Mixed: typeCode = 2; break; } LogInfo($"Starting work on \'{source.Url}\'"); GetMediaFromYoutube(source.Url, typeCode, ols.ToArray()); } } } catch (Exception ex) { LogInfo(ex.ToString()); } } }