diff --git a/TidalDownloader/Form1.Designer.cs b/TidalDownloader/Form1.Designer.cs index 4693d07..0f6eb4c 100644 --- a/TidalDownloader/Form1.Designer.cs +++ b/TidalDownloader/Form1.Designer.cs @@ -28,12 +28,206 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + this.URI = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.downloadButton = new System.Windows.Forms.Button(); + this.output = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.startNo = new System.Windows.Forms.NumericUpDown(); + this.endNo = new System.Windows.Forms.NumericUpDown(); + this.label3 = new System.Windows.Forms.Label(); + this.stitchButton = new System.Windows.Forms.Button(); + this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); + this.pickFolder = new System.Windows.Forms.Button(); + this.outfile = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.suffix = new System.Windows.Forms.TextBox(); + ((System.ComponentModel.ISupportInitialize)(this.startNo)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.endNo)).BeginInit(); + this.SuspendLayout(); + // + // URI + // + this.URI.Location = new System.Drawing.Point(12, 29); + this.URI.Name = "URI"; + this.URI.Size = new System.Drawing.Size(260, 20); + this.URI.TabIndex = 0; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(13, 13); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(103, 13); + this.label1.TabIndex = 1; + this.label1.Text = "TIDAL URI segment"; + // + // downloadButton + // + this.downloadButton.Location = new System.Drawing.Point(12, 152); + this.downloadButton.Name = "downloadButton"; + this.downloadButton.Size = new System.Drawing.Size(97, 23); + this.downloadButton.TabIndex = 2; + this.downloadButton.Text = "Download"; + this.downloadButton.UseVisualStyleBackColor = true; + this.downloadButton.Click += new System.EventHandler(this.clickDownload); + // + // output + // + this.output.Location = new System.Drawing.Point(115, 122); + this.output.Multiline = true; + this.output.Name = "output"; + this.output.ReadOnly = true; + this.output.Size = new System.Drawing.Size(157, 194); + this.output.TabIndex = 3; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 195); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(32, 13); + this.label2.TabIndex = 4; + this.label2.Text = "Start:"; + // + // startNo + // + this.startNo.Location = new System.Drawing.Point(50, 192); + this.startNo.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.startNo.Name = "startNo"; + this.startNo.Size = new System.Drawing.Size(59, 20); + this.startNo.TabIndex = 5; + // + // endNo + // + this.endNo.Location = new System.Drawing.Point(50, 219); + this.endNo.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.endNo.Name = "endNo"; + this.endNo.Size = new System.Drawing.Size(59, 20); + this.endNo.TabIndex = 7; + this.endNo.Value = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(12, 221); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(29, 13); + this.label3.TabIndex = 6; + this.label3.Text = "End:"; + // + // stitchButton + // + this.stitchButton.Location = new System.Drawing.Point(12, 293); + this.stitchButton.Name = "stitchButton"; + this.stitchButton.Size = new System.Drawing.Size(97, 23); + this.stitchButton.TabIndex = 8; + this.stitchButton.Text = "Stitch"; + this.stitchButton.UseVisualStyleBackColor = true; + this.stitchButton.Click += new System.EventHandler(this.stitchButton_Click); + // + // pickFolder + // + this.pickFolder.Location = new System.Drawing.Point(13, 123); + this.pickFolder.Name = "pickFolder"; + this.pickFolder.Size = new System.Drawing.Size(96, 23); + this.pickFolder.TabIndex = 9; + this.pickFolder.Text = "Choose Folder"; + this.pickFolder.UseVisualStyleBackColor = true; + this.pickFolder.Click += new System.EventHandler(this.pickFolder_Click); + // + // outfile + // + this.outfile.Location = new System.Drawing.Point(12, 267); + this.outfile.Name = "outfile"; + this.outfile.Size = new System.Drawing.Size(97, 20); + this.outfile.TabIndex = 10; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(9, 251); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(52, 13); + this.label4.TabIndex = 11; + this.label4.Text = "Filename:"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(13, 59); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(33, 13); + this.label5.TabIndex = 13; + this.label5.Text = "Suffix"; + // + // suffix + // + this.suffix.Location = new System.Drawing.Point(12, 75); + this.suffix.Name = "suffix"; + this.suffix.Size = new System.Drawing.Size(260, 20); + this.suffix.TabIndex = 12; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Text = "Form1"; + this.ClientSize = new System.Drawing.Size(284, 328); + this.Controls.Add(this.label5); + this.Controls.Add(this.suffix); + this.Controls.Add(this.label4); + this.Controls.Add(this.outfile); + this.Controls.Add(this.pickFolder); + this.Controls.Add(this.stitchButton); + this.Controls.Add(this.endNo); + this.Controls.Add(this.label3); + this.Controls.Add(this.startNo); + this.Controls.Add(this.label2); + this.Controls.Add(this.output); + this.Controls.Add(this.downloadButton); + this.Controls.Add(this.label1); + this.Controls.Add(this.URI); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "Form1"; + this.Text = "TIDAL Downloader"; + ((System.ComponentModel.ISupportInitialize)(this.startNo)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.endNo)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + } #endregion + + private System.Windows.Forms.TextBox URI; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button downloadButton; + private System.Windows.Forms.TextBox output; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.NumericUpDown startNo; + private System.Windows.Forms.NumericUpDown endNo; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Button stitchButton; + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog; + private System.Windows.Forms.Button pickFolder; + private System.Windows.Forms.TextBox outfile; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox suffix; } } diff --git a/TidalDownloader/Form1.cs b/TidalDownloader/Form1.cs index f11fe18..2b8c7c1 100644 --- a/TidalDownloader/Form1.cs +++ b/TidalDownloader/Form1.cs @@ -7,6 +7,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using System.Net; +using System.IO; +using System.Diagnostics; namespace TidalDownloader { @@ -16,5 +19,88 @@ namespace TidalDownloader { 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); + } } } diff --git a/TidalDownloader/Form1.resx b/TidalDownloader/Form1.resx new file mode 100644 index 0000000..2ce0b5d --- /dev/null +++ b/TidalDownloader/Form1.resx @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + + AAABAAIAEBAAAAAAIABoBAAAJgAAACAgAAAAACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAEAE + AAAAAAAAAAAAAAAAAAAAAAAA////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////AS0t + LYsiIiKZ////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////ATMz + M4UAAAD/AAAA/ykpKZP///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////AS4u + LmEAAAD/AAAA/wAAAP8AAAD/IiIicf///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wFMTEwDBgYGqwAAAP8AAAD/BwcHu1VVVQf///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////AcrKygMZGRmtBgYGvSsrKwf///8B////Af///wH///8B////Af///wH///8B////ARkZ + GX2YmJgV////Af///wH///8BLS0tVygoKGP///8B////Af///wGsrKwPFRUVh////wH///8B////ARIS + Eo8AAAD/Dg4O04aGhhv///8BJCQkQwMDA/cBAQH7KCgoUf///wGZmZkVDAwMzQAAAP8ODg6d////ARAQ + EI0AAAD/AAAA/wAAAP8RERHbUlJSSwQEBPcAAAD/AAAA/wEBAftKSkpVERER0wAAAP8AAAD/AAAA/xIS + EpksLCxhAAAA/wAAAP8AAAD/FxcXsVtbWyUKCgrdAAAA/wAAAP8KCgrjR0dHKR4eHqEAAAD/AAAA/wAA + AP8QEBBt////ATIyMlkAAAD/Gxsbof///wH///8BTU1NHwkJCd0JCQnlQUFBJf///wH///8BJCQklQAA + AP8qKipl////Af///wH///8BS0tLRdra2gP///8B////Af///wEzMzMnKysrLf///wH///8B////Af// + /wFMTExJ////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////AQAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA + //8AAP//AAD//wAA//8AAP//AAD//wAA//8oAAAAIAAAAEAAAAABACAAAAAAAIAQAAAAAAAAAAAAAAAA + AAAAAAAA////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BSEhIozAw + ML3///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////AWFh + YYsAAAD/AAAA/0hISKf///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wFjY2OJAAAA/wAAAP8AAAD/AAAA/0lJSaX///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8BZWVliQAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/0tLS6X///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////AV5eXqUAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/0VFRb////8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wF3d3cDCgoK2wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA8XBw + cBf///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wFMTEwHCgoK0QAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wkJ + CedVVVUb////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wFGRkYJCAgI0wAAAP8AAAD/AAAA/wAA + AP8FBQXpTU1NG////wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wHKysoJHh4e0wAA + AP8AAAD/AAAA6SsrKxv///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wHt7e0LKCgo2wAAAPGmpqYd////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8BMzMzFYqKijn///8B////Af///wH///8B////Af// + /wH///8B////Af///wGZmZlXZWVlY////wH///8B////Af///wH///8B////Af///wH///8B////AZmZ + mTUzMzMf////Af///wH///8B////Af///wH///8B////Af///wEXFxenAAAA/5iYmFX///8B////Af// + /wH///8B////Af///wH///8BeXl5FQAAAO0EBAT/gICAKf///wH///8B////Af///wH///8B////Af// + /wGsrKw7AAAA/wsLC8f///8B////Af///wH///8B////Af///wH///8BISEhnQAAAP8AAAD/AAAA/5iY + mFP///8B////Af///wH///8B////AZOTkxUQEBDhAAAA/wAAAP8GBgbzkJCQKf///wH///8B////Af// + /wH///8BqqqqOwAAAP8AAAD/AAAA/xgYGLn///8B////Af///wH///8B////ASIiIp0AAAD/AAAA/wAA + AP8AAAD/AAAA/4aGhmf///8B////Af///wGcnJwTERER4QAAAP8AAAD/AAAA/wAAAP8GBgbzmJiYJ/// + /wH///8B////AZmZmVEAAAD/AAAA/wAAAP8AAAD/AAAA/xgYGLn///8B////Af///wEsLCybAAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/46Ojm3///8BnJycDxQUFN8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8ICAjzk5OTJf///wGhoaFTAAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/x8fH7f///8BEhISmQAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/3t7e2U3Nze3AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8kJCTRg4ODXwUFBf0AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/yAg + ILFTU1NRCQkJ/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8lJSXdrq6uF01NTXsAAAD/AAAA/wAA + AP8AAAD/AAAA/wAAAP8AAAD/AAAA/z4+PpexsbEPNTU1xwAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA + AP8AAAD/KSkpZ////wGlpaUzAAAA/QAAAP8AAAD/AAAA/wAAAP8AAAD/Gxsb2ejo6A3///8B////AU5O + TnkAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP9DQ0OT////Af///wH///8BLi4uwQAAAP8AAAD/AAAA/wAA + AP8AAAD/AAAA/ycnJ0v///8B////Af///wGtra0zAAAA/QAAAP8AAAD/AAAA/ywsLMXj4+MF////Af// + /wH///8B////AU1NTXsAAAD/AAAA/wAAAP8AAAD/QUFBlf///wH///8B////Af///wH///8BPDw8rwAA + AP8AAAD/AAAA/wEBAf9UVFRL////Af///wH///8B////Af///wGwsLA1AAAA/QAAAP8vLy/B////Af// + /wH///8B////Af///wH///8B////AUhISHsAAAD/AAAA/z09PZX///8B////Af///wH///8B////Af// + /wH///8BQ0NDpwAAAP8AAAD/jo6OTf///wH///8B////Af///wH///8B////Af///wGjo6NTJycnw9ra + 2g3///8B////Af///wH///8B////Af///wH///8B////ATMzM5krKyuv////Af///wH///8B////Af// + /wH///8B////Af///wH///8BLy8vt35+fm////8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af// + /wH///8B////Af///wH///8B////AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + + + \ No newline at end of file diff --git a/TidalDownloader/TidalDownloader.csproj b/TidalDownloader/TidalDownloader.csproj index f71af0b..f8bb75d 100644 --- a/TidalDownloader/TidalDownloader.csproj +++ b/TidalDownloader/TidalDownloader.csproj @@ -54,6 +54,9 @@ + + Form1.cs + ResXFileCodeGenerator Resources.Designer.cs @@ -76,6 +79,9 @@ + + +