private void btnDownloadFromWeb_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Go to the Chrome Inspector, go to the Network tab, " +
                            "and refresh the page. Look for a .mp4, .m3u, or .m3u8 url.");
            var url = InputBoxForm.GetStrInput("Enter the url that was seen,");

            if (!String.IsNullOrEmpty(url))
            {
                RunToolHelper.RunAndCatch(() =>
                {
                    downloadFromWeb(url);
                });
            }
        }
Ejemplo n.º 2
0
        private void doCustomEncode(string example, InputBoxHistory key)
        {
            var files = this.GetInputFiles(1);
            var cmd   = InputBoxForm.GetStrInput("Command for the ffmpeg encoder:", example,
                                                 key);

            if (String.IsNullOrEmpty(cmd))
            {
                return;
            }
            else if (!cmd.Contains("%in%") && !Utils.AskToConfirm("Did not see '%in%', " +
                                                                  "won't process input files. Continue?"))
            {
                return;
            }

            if (!Utils.AskToConfirm("Run the command right now? (or copy the command line to the clipboard)"))
            {
                var s = "";
                foreach (var file in files)
                {
                    s += "\r\n\"" + CsDownloadVidFilepaths.GetFfmpeg() + "\" ";
                    s += cmd.Replace("%in%", files[0]);
                }

                Clipboard.SetText(s);
                MessageBox.Show("Command was copied to the clipboard.");
                return;
            }

            RunToolHelper.RunAndCatch(() =>
            {
                var infos = new List <ProcessStartInfo>();
                foreach (var file in files)
                {
                    var info                    = new ProcessStartInfo();
                    info.FileName               = CsDownloadVidFilepaths.GetFfmpeg();
                    info.Arguments              = cmd.Replace("%in%", file);
                    info.CreateNoWindow         = true;
                    info.RedirectStandardError  = true;
                    info.RedirectStandardOutput = true;
                    info.UseShellExecute        = false;
                    infos.Add(info);
                }

                _runner.RunProcesses(infos.ToArray(), "Custom encode");
            });
        }