Skip to content

Commit

Permalink
Started build - works for all without a "suffix" in their segment URI…
Browse files Browse the repository at this point in the history
… (ie. Famous, New Workout Plan but not Lemonade)
  • Loading branch information
italicsjenga committed Jun 27, 2016
1 parent 2cb0199 commit 0452d28
Show file tree
Hide file tree
Showing 5 changed files with 507 additions and 2 deletions.
198 changes: 196 additions & 2 deletions TidalDownloader/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 86 additions & 0 deletions TidalDownloader/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.IO;
using System.Diagnostics;

namespace TidalDownloader
{
Expand All @@ -16,5 +19,88 @@ public Form1()
{
InitializeComponent();
}

private void clickDownload(object sender, EventArgs e)
{
WebClient wc = new WebClient();

if(folderBrowserDialog.SelectedPath == null | folderBrowserDialog.SelectedPath == "")
{
output.AppendText("Error: no path selected\n");
return;
}

if(URI.Text == null | URI.Text == "")
{
output.AppendText("Error: no partial Tidal URI\n");
return;
}

String loc = folderBrowserDialog.SelectedPath;

for (int i = (int)startNo.Value; i < (int)endNo.Value + 1; i++)
{
output.AppendText("Downloading section #" + i.ToString() + "\n");

try
{
wc.DownloadFile(URI.Text + i.ToString() + ".ts" + suffix.Text, loc + "\\" + i.ToString() + ".ts");
}
catch
{
output.AppendText("Error downloading section #" + i.ToString() + "\n");
break;
}
}
}

private void pickFolder_Click(object sender, EventArgs e)
{
folderBrowserDialog.ShowDialog();
}

private void stitchButton_Click(object sender, EventArgs e)
{
if (folderBrowserDialog.SelectedPath == null | folderBrowserDialog.SelectedPath == "")
{
output.AppendText("Error: no path selected\n");
return;
}

if (outfile.Text == null | outfile.Text == "")
{
output.AppendText("Error: no output filename\n");
return;
}

String command = " -i \"concat:";

for (int i = (int)startNo.Value; i < (int)endNo.Value + 1; i++)
{
command += folderBrowserDialog.SelectedPath + "\\" + i.ToString() + ".ts";

if (i != (int)endNo.Value)
{
command += "|";
}
}

command += "\" -c copy -bsf aac_adtstoasc \"" + folderBrowserDialog.SelectedPath + "\\" + outfile.Text + ".mp4\"";

Console.WriteLine(command);

var proc1 = new ProcessStartInfo();
proc1.UseShellExecute = true;

proc1.WorkingDirectory = folderBrowserDialog.SelectedPath;

proc1.FileName = @"C:\Program Files\ImageMagick-6.9.3-Q16\ffmpeg.exe";
proc1.Verb = "runas";
proc1.Arguments = command;
proc1.WindowStyle = ProcessWindowStyle.Hidden;
Process.Start(proc1);

//Process.Start("ffmpeg", command);
}
}
}
Loading

0 comments on commit 0452d28

Please sign in to comment.