diff --git a/QobuzDownloaderX/App.config b/QobuzDownloaderX/App.config index 61b970f..7e49e43 100644 --- a/QobuzDownloaderX/App.config +++ b/QobuzDownloaderX/App.config @@ -118,6 +118,13 @@ 36 + + 1 + + + + + diff --git a/QobuzDownloaderX/Form1.Designer.cs b/QobuzDownloaderX/Form1.Designer.cs index 2870ecc..387752d 100644 --- a/QobuzDownloaderX/Form1.Designer.cs +++ b/QobuzDownloaderX/Form1.Designer.cs @@ -113,6 +113,12 @@ this.panel9 = new System.Windows.Forms.Panel(); this.maxLengthTextbox = new System.Windows.Forms.TextBox(); this.maxLengthWarnLabel = new System.Windows.Forms.Label(); + this.customFormatPanel = new System.Windows.Forms.Panel(); + this.customFormatIDTextbox = new System.Windows.Forms.TextBox(); + this.formatIDLabel = new System.Windows.Forms.Label(); + this.filenameTempSelect = new System.Windows.Forms.ComboBox(); + this.label7 = new System.Windows.Forms.Label(); + this.downloadPlaylistBG = new System.ComponentModel.BackgroundWorker(); ((System.ComponentModel.ISupportInitialize)(this.albumArtPicBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.logoBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.profilePictureBox)).BeginInit(); @@ -449,7 +455,7 @@ this.albumArtistCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.albumArtistCheckbox.FlatAppearance.BorderSize = 0; this.albumArtistCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.albumArtistCheckbox.Location = new System.Drawing.Point(325, 563); + this.albumArtistCheckbox.Location = new System.Drawing.Point(12, 540); this.albumArtistCheckbox.Name = "albumArtistCheckbox"; this.albumArtistCheckbox.Size = new System.Drawing.Size(81, 17); this.albumArtistCheckbox.TabIndex = 62; @@ -464,7 +470,7 @@ this.artistCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.artistCheckbox.FlatAppearance.BorderSize = 0; this.artistCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.artistCheckbox.Location = new System.Drawing.Point(325, 609); + this.artistCheckbox.Location = new System.Drawing.Point(183, 540); this.artistCheckbox.Name = "artistCheckbox"; this.artistCheckbox.Size = new System.Drawing.Size(80, 17); this.artistCheckbox.TabIndex = 63; @@ -479,7 +485,7 @@ this.trackTitleCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.trackTitleCheckbox.FlatAppearance.BorderSize = 0; this.trackTitleCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.trackTitleCheckbox.Location = new System.Drawing.Point(325, 586); + this.trackTitleCheckbox.Location = new System.Drawing.Point(269, 540); this.trackTitleCheckbox.Name = "trackTitleCheckbox"; this.trackTitleCheckbox.Size = new System.Drawing.Size(77, 17); this.trackTitleCheckbox.TabIndex = 64; @@ -494,7 +500,7 @@ this.trackNumberCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.trackNumberCheckbox.FlatAppearance.BorderSize = 0; this.trackNumberCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.trackNumberCheckbox.Location = new System.Drawing.Point(325, 632); + this.trackNumberCheckbox.Location = new System.Drawing.Point(104, 568); this.trackNumberCheckbox.Name = "trackNumberCheckbox"; this.trackNumberCheckbox.Size = new System.Drawing.Size(94, 17); this.trackNumberCheckbox.TabIndex = 65; @@ -509,7 +515,7 @@ this.trackTotalCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.trackTotalCheckbox.FlatAppearance.BorderSize = 0; this.trackTotalCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.trackTotalCheckbox.Location = new System.Drawing.Point(325, 655); + this.trackTotalCheckbox.Location = new System.Drawing.Point(12, 568); this.trackTotalCheckbox.Name = "trackTotalCheckbox"; this.trackTotalCheckbox.Size = new System.Drawing.Size(86, 17); this.trackTotalCheckbox.TabIndex = 66; @@ -524,7 +530,7 @@ this.discNumberCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.discNumberCheckbox.FlatAppearance.BorderSize = 0; this.discNumberCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.discNumberCheckbox.Location = new System.Drawing.Point(325, 676); + this.discNumberCheckbox.Location = new System.Drawing.Point(289, 568); this.discNumberCheckbox.Name = "discNumberCheckbox"; this.discNumberCheckbox.Size = new System.Drawing.Size(87, 17); this.discNumberCheckbox.TabIndex = 67; @@ -539,7 +545,7 @@ this.discTotalCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.discTotalCheckbox.FlatAppearance.BorderSize = 0; this.discTotalCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.discTotalCheckbox.Location = new System.Drawing.Point(325, 699); + this.discTotalCheckbox.Location = new System.Drawing.Point(204, 568); this.discTotalCheckbox.Name = "discTotalCheckbox"; this.discTotalCheckbox.Size = new System.Drawing.Size(79, 17); this.discTotalCheckbox.TabIndex = 68; @@ -554,7 +560,7 @@ this.albumCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.albumCheckbox.FlatAppearance.BorderSize = 0; this.albumCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.albumCheckbox.Location = new System.Drawing.Point(325, 540); + this.albumCheckbox.Location = new System.Drawing.Point(99, 540); this.albumCheckbox.Name = "albumCheckbox"; this.albumCheckbox.Size = new System.Drawing.Size(78, 17); this.albumCheckbox.TabIndex = 69; @@ -569,7 +575,7 @@ this.explicitCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.explicitCheckbox.FlatAppearance.BorderSize = 0; this.explicitCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.explicitCheckbox.Location = new System.Drawing.Point(425, 678); + this.explicitCheckbox.Location = new System.Drawing.Point(458, 568); this.explicitCheckbox.Name = "explicitCheckbox"; this.explicitCheckbox.Size = new System.Drawing.Size(106, 17); this.explicitCheckbox.TabIndex = 76; @@ -584,7 +590,7 @@ this.upcCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.upcCheckbox.FlatAppearance.BorderSize = 0; this.upcCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.upcCheckbox.Location = new System.Drawing.Point(425, 655); + this.upcCheckbox.Location = new System.Drawing.Point(763, 540); this.upcCheckbox.Name = "upcCheckbox"; this.upcCheckbox.Size = new System.Drawing.Size(52, 17); this.upcCheckbox.TabIndex = 75; @@ -599,7 +605,7 @@ this.isrcCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.isrcCheckbox.FlatAppearance.BorderSize = 0; this.isrcCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.isrcCheckbox.Location = new System.Drawing.Point(425, 632); + this.isrcCheckbox.Location = new System.Drawing.Point(821, 540); this.isrcCheckbox.Name = "isrcCheckbox"; this.isrcCheckbox.Size = new System.Drawing.Size(51, 17); this.isrcCheckbox.TabIndex = 74; @@ -614,7 +620,7 @@ this.copyrightCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.copyrightCheckbox.FlatAppearance.BorderSize = 0; this.copyrightCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.copyrightCheckbox.Location = new System.Drawing.Point(425, 609); + this.copyrightCheckbox.Location = new System.Drawing.Point(687, 540); this.copyrightCheckbox.Name = "copyrightCheckbox"; this.copyrightCheckbox.Size = new System.Drawing.Size(70, 17); this.copyrightCheckbox.TabIndex = 73; @@ -629,7 +635,7 @@ this.composerCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.composerCheckbox.FlatAppearance.BorderSize = 0; this.composerCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.composerCheckbox.Location = new System.Drawing.Point(425, 586); + this.composerCheckbox.Location = new System.Drawing.Point(608, 540); this.composerCheckbox.Name = "composerCheckbox"; this.composerCheckbox.Size = new System.Drawing.Size(73, 17); this.composerCheckbox.TabIndex = 72; @@ -644,7 +650,7 @@ this.genreCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.genreCheckbox.FlatAppearance.BorderSize = 0; this.genreCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.genreCheckbox.Location = new System.Drawing.Point(425, 563); + this.genreCheckbox.Location = new System.Drawing.Point(547, 540); this.genreCheckbox.Name = "genreCheckbox"; this.genreCheckbox.Size = new System.Drawing.Size(55, 17); this.genreCheckbox.TabIndex = 71; @@ -659,7 +665,7 @@ this.releaseCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.releaseCheckbox.FlatAppearance.BorderSize = 0; this.releaseCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.releaseCheckbox.Location = new System.Drawing.Point(425, 540); + this.releaseCheckbox.Location = new System.Drawing.Point(450, 540); this.releaseCheckbox.Name = "releaseCheckbox"; this.releaseCheckbox.Size = new System.Drawing.Size(91, 17); this.releaseCheckbox.TabIndex = 70; @@ -672,7 +678,7 @@ this.commentCheckbox.AutoSize = true; this.commentCheckbox.FlatAppearance.BorderSize = 0; this.commentCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.commentCheckbox.Location = new System.Drawing.Point(533, 699); + this.commentCheckbox.Location = new System.Drawing.Point(570, 568); this.commentCheckbox.Name = "commentCheckbox"; this.commentCheckbox.Size = new System.Drawing.Size(70, 17); this.commentCheckbox.TabIndex = 78; @@ -685,7 +691,7 @@ this.commentTextbox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); this.commentTextbox.BorderStyle = System.Windows.Forms.BorderStyle.None; this.commentTextbox.ForeColor = System.Drawing.Color.White; - this.commentTextbox.Location = new System.Drawing.Point(609, 697); + this.commentTextbox.Location = new System.Drawing.Point(646, 566); this.commentTextbox.Multiline = true; this.commentTextbox.Name = "commentTextbox"; this.commentTextbox.Size = new System.Drawing.Size(112, 17); @@ -699,7 +705,7 @@ this.imageCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.imageCheckbox.FlatAppearance.BorderSize = 0; this.imageCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.imageCheckbox.Location = new System.Drawing.Point(425, 699); + this.imageCheckbox.Location = new System.Drawing.Point(382, 568); this.imageCheckbox.Name = "imageCheckbox"; this.imageCheckbox.Size = new System.Drawing.Size(70, 17); this.imageCheckbox.TabIndex = 80; @@ -761,7 +767,7 @@ // this.mp3WarnLabel.AutoSize = true; this.mp3WarnLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.mp3WarnLabel.Location = new System.Drawing.Point(744, 697); + this.mp3WarnLabel.Location = new System.Drawing.Point(744, 596); this.mp3WarnLabel.Name = "mp3WarnLabel"; this.mp3WarnLabel.Size = new System.Drawing.Size(182, 13); this.mp3WarnLabel.TabIndex = 85; @@ -858,7 +864,7 @@ // panel8 // this.panel8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.panel8.Location = new System.Drawing.Point(609, 716); + this.panel8.Location = new System.Drawing.Point(646, 585); this.panel8.Name = "panel8"; this.panel8.Size = new System.Drawing.Size(112, 1); this.panel8.TabIndex = 90; @@ -959,7 +965,7 @@ "150", "100", "50"}); - this.artSizeSelect.Location = new System.Drawing.Point(634, 538); + this.artSizeSelect.Location = new System.Drawing.Point(113, 593); this.artSizeSelect.Name = "artSizeSelect"; this.artSizeSelect.Size = new System.Drawing.Size(87, 21); this.artSizeSelect.TabIndex = 96; @@ -969,11 +975,11 @@ // this.artSizeLabel.AutoSize = true; this.artSizeLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.artSizeLabel.Location = new System.Drawing.Point(530, 541); + this.artSizeLabel.Location = new System.Drawing.Point(12, 596); this.artSizeLabel.Name = "artSizeLabel"; - this.artSizeLabel.Size = new System.Drawing.Size(210, 13); + this.artSizeLabel.Size = new System.Drawing.Size(207, 13); this.artSizeLabel.TabIndex = 97; - this.artSizeLabel.Text = "Embedded Art Size: px"; + this.artSizeLabel.Text = "Embedded Art Size: px"; // // typeCheckbox // @@ -982,7 +988,7 @@ this.typeCheckbox.CheckState = System.Windows.Forms.CheckState.Checked; this.typeCheckbox.FlatAppearance.BorderSize = 0; this.typeCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.typeCheckbox.Location = new System.Drawing.Point(533, 676); + this.typeCheckbox.Location = new System.Drawing.Point(352, 540); this.typeCheckbox.Name = "typeCheckbox"; this.typeCheckbox.Size = new System.Drawing.Size(92, 17); this.typeCheckbox.TabIndex = 98; @@ -1040,7 +1046,7 @@ // this.maxLengthLabel.AutoSize = true; this.maxLengthLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.maxLengthLabel.Location = new System.Drawing.Point(530, 567); + this.maxLengthLabel.Location = new System.Drawing.Point(444, 596); this.maxLengthLabel.Name = "maxLengthLabel"; this.maxLengthLabel.Size = new System.Drawing.Size(121, 13); this.maxLengthLabel.TabIndex = 102; @@ -1049,7 +1055,7 @@ // panel9 // this.panel9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.panel9.Location = new System.Drawing.Point(653, 586); + this.panel9.Location = new System.Drawing.Point(567, 610); this.panel9.Name = "panel9"; this.panel9.Size = new System.Drawing.Size(68, 1); this.panel9.TabIndex = 92; @@ -1059,7 +1065,7 @@ this.maxLengthTextbox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); this.maxLengthTextbox.BorderStyle = System.Windows.Forms.BorderStyle.None; this.maxLengthTextbox.ForeColor = System.Drawing.Color.White; - this.maxLengthTextbox.Location = new System.Drawing.Point(653, 567); + this.maxLengthTextbox.Location = new System.Drawing.Point(567, 596); this.maxLengthTextbox.Multiline = true; this.maxLengthTextbox.Name = "maxLengthTextbox"; this.maxLengthTextbox.Size = new System.Drawing.Size(68, 17); @@ -1070,18 +1076,84 @@ // this.maxLengthWarnLabel.AutoSize = true; this.maxLengthWarnLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); - this.maxLengthWarnLabel.Location = new System.Drawing.Point(819, 711); + this.maxLengthWarnLabel.Location = new System.Drawing.Point(819, 610); this.maxLengthWarnLabel.Name = "maxLengthWarnLabel"; this.maxLengthWarnLabel.Size = new System.Drawing.Size(107, 13); this.maxLengthWarnLabel.TabIndex = 103; this.maxLengthWarnLabel.Text = "** = Max value is 110"; // + // customFormatPanel + // + this.customFormatPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); + this.customFormatPanel.Location = new System.Drawing.Point(572, 60); + this.customFormatPanel.Name = "customFormatPanel"; + this.customFormatPanel.Size = new System.Drawing.Size(19, 1); + this.customFormatPanel.TabIndex = 104; + this.customFormatPanel.Visible = false; + // + // customFormatIDTextbox + // + this.customFormatIDTextbox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); + this.customFormatIDTextbox.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.customFormatIDTextbox.ForeColor = System.Drawing.Color.White; + this.customFormatIDTextbox.Location = new System.Drawing.Point(572, 42); + this.customFormatIDTextbox.Multiline = true; + this.customFormatIDTextbox.Name = "customFormatIDTextbox"; + this.customFormatIDTextbox.Size = new System.Drawing.Size(19, 20); + this.customFormatIDTextbox.TabIndex = 105; + this.customFormatIDTextbox.Visible = false; + this.customFormatIDTextbox.WordWrap = false; + this.customFormatIDTextbox.TextChanged += new System.EventHandler(this.customFormatIDTextbox_TextChanged); + // + // formatIDLabel + // + this.formatIDLabel.AutoSize = true; + this.formatIDLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); + this.formatIDLabel.Location = new System.Drawing.Point(513, 42); + this.formatIDLabel.Name = "formatIDLabel"; + this.formatIDLabel.Size = new System.Drawing.Size(53, 13); + this.formatIDLabel.TabIndex = 106; + this.formatIDLabel.Text = "Format ID"; + this.formatIDLabel.Visible = false; + // + // filenameTempSelect + // + this.filenameTempSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.filenameTempSelect.FormattingEnabled = true; + this.filenameTempSelect.Items.AddRange(new object[] { + "00 Trackname", + "00 - Trackname"}); + this.filenameTempSelect.Location = new System.Drawing.Point(325, 593); + this.filenameTempSelect.Name = "filenameTempSelect"; + this.filenameTempSelect.Size = new System.Drawing.Size(108, 21); + this.filenameTempSelect.TabIndex = 107; + this.filenameTempSelect.SelectedIndexChanged += new System.EventHandler(this.filenameTempSelect_SelectedIndexChanged); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); + this.label7.Location = new System.Drawing.Point(225, 596); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(99, 13); + this.label7.TabIndex = 108; + this.label7.Text = "Filename Template:"; + // + // downloadPlaylistBG + // + this.downloadPlaylistBG.DoWork += new System.ComponentModel.DoWorkEventHandler(this.downloadPlaylistBG_DoWork); + // // QobuzDownloaderX // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); - this.ClientSize = new System.Drawing.Size(938, 733); + this.ClientSize = new System.Drawing.Size(938, 632); + this.Controls.Add(this.filenameTempSelect); + this.Controls.Add(this.label7); + this.Controls.Add(this.formatIDLabel); + this.Controls.Add(this.customFormatPanel); + this.Controls.Add(this.customFormatIDTextbox); this.Controls.Add(this.maxLengthWarnLabel); this.Controls.Add(this.panel9); this.Controls.Add(this.maxLengthTextbox); @@ -1259,6 +1331,12 @@ private System.Windows.Forms.Panel panel9; private System.Windows.Forms.TextBox maxLengthTextbox; private System.Windows.Forms.Label maxLengthWarnLabel; + private System.Windows.Forms.Panel customFormatPanel; + private System.Windows.Forms.TextBox customFormatIDTextbox; + private System.Windows.Forms.Label formatIDLabel; + private System.Windows.Forms.ComboBox filenameTempSelect; + private System.Windows.Forms.Label label7; + private System.ComponentModel.BackgroundWorker downloadPlaylistBG; } } diff --git a/QobuzDownloaderX/Form1.cs b/QobuzDownloaderX/Form1.cs index 107ea60..8ff5e3e 100644 --- a/QobuzDownloaderX/Form1.cs +++ b/QobuzDownloaderX/Form1.cs @@ -57,6 +57,7 @@ namespace QobuzDownloaderX public string audioFileType { get; set; } public string trackRequest { get; set; } public string artSize { get; set; } + public string fileNameTemplateString { get; set; } public string finalTrackNamePath { get; set; } public string finalTrackNameVersionPath { get; set; } public int MaxLength { get; set; } @@ -94,6 +95,7 @@ namespace QobuzDownloaderX public string releaseDate { get; set; } public string isrc { get; set; } public string upc { get; set; } + public string playlistCoverImg { get; set; } public string frontCoverImg { get; set; } public string frontCoverImgBox { get; set; } public string goodiesPDF { get; set; } @@ -182,8 +184,12 @@ namespace QobuzDownloaderX formatIdString = Settings.Default.qualityFormat; audioFileType = Settings.Default.audioType; artSizeSelect.SelectedIndex = Settings.Default.savedArtSize; + filenameTempSelect.SelectedIndex = Settings.Default.savedFilenameTemplate; + fileNameTemplateString = Settings.Default.savedFilenameTemplateString; MaxLength = Settings.Default.savedMaxLength; + customFormatIDTextbox.Text = formatIdString; + artSize = artSizeSelect.Text; maxLengthTextbox.Text = MaxLength.ToString(); #endregion @@ -511,11 +517,7 @@ namespace QobuzDownloaderX } else if (linkType == "playlist") { - // Say what isn't available at the moment. - output.Invoke(new Action(() => output.Text = String.Empty)); - output.Invoke(new Action(() => output.AppendText("Downloading playlists is not available right now. Maybe in the future. Sorry."))); - enableBoxes(sender, e); - return; + downloadPlaylistBG.RunWorkerAsync(); } else { @@ -885,23 +887,23 @@ namespace QobuzDownloaderX switch (versionName) { case null: - if ((trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).Length > MaxLength) + if ((trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).Length > MaxLength) { - finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).Substring(0, MaxLength).TrimEnd(); + finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).Substring(0, MaxLength).TrimEnd(); } else { - finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).TrimEnd(); + finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).TrimEnd(); } break; default: - if ((trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").Length > MaxLength) + if ((trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").Length > MaxLength) { - finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").Substring(0, MaxLength).TrimEnd(); + finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").Substring(0, MaxLength).TrimEnd(); } else { - finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").TrimEnd(); + finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").TrimEnd(); } break; } @@ -917,7 +919,7 @@ namespace QobuzDownloaderX if (System.IO.File.Exists(checkFile)) { - output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackName + "\" already exists. Skipping.\r\n"))); + output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackName + "\" already exists. Skipping.\r\n"))); System.Threading.Thread.Sleep(100); continue; } @@ -928,7 +930,7 @@ namespace QobuzDownloaderX if (System.IO.File.Exists(checkFileVersion)) { - output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackName + " (" + versionName + ")" + "\" already exists. Skipping.\r\n"))); + output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackName + " (" + versionName + ")" + "\" already exists. Skipping.\r\n"))); System.Threading.Thread.Sleep(100); continue; } @@ -1699,23 +1701,23 @@ namespace QobuzDownloaderX switch (versionName) { case null: - if ((trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).Length > MaxLength) + if ((trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).Length > MaxLength) { - finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).Substring(0, MaxLength).TrimEnd(); + finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).Substring(0, MaxLength).TrimEnd(); } else { - finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).TrimEnd(); + finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).TrimEnd(); } break; default: - if ((trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").Length > MaxLength) + if ((trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").Length > MaxLength) { - finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").Substring(0, MaxLength).TrimEnd(); + finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").Substring(0, MaxLength).TrimEnd(); } else { - finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").TrimEnd(); + finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").TrimEnd(); } break; } @@ -1731,7 +1733,7 @@ namespace QobuzDownloaderX if (System.IO.File.Exists(checkFile)) { - output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackName + "\" already exists. Skipping.\r\n"))); + output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackName + "\" already exists. Skipping.\r\n"))); System.Threading.Thread.Sleep(100); continue; } @@ -1742,7 +1744,7 @@ namespace QobuzDownloaderX if (System.IO.File.Exists(checkFileVersion)) { - output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackName + " (" + versionName + ")" + "\" already exists. Skipping.\r\n"))); + output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackName + " (" + versionName + ")" + "\" already exists. Skipping.\r\n"))); System.Threading.Thread.Sleep(100); continue; } @@ -2505,23 +2507,23 @@ namespace QobuzDownloaderX switch (versionName) { case null: - if ((trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).Length > MaxLength) + if ((trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).Length > MaxLength) { - finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).Substring(0, MaxLength).TrimEnd(); + finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).Substring(0, MaxLength).TrimEnd(); } else { - finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).TrimEnd(); + finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).TrimEnd(); } break; default: - if ((trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").Length > MaxLength) + if ((trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").Length > MaxLength) { - finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").Substring(0, MaxLength).TrimEnd(); + finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").Substring(0, MaxLength).TrimEnd(); } else { - finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").TrimEnd(); + finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").TrimEnd(); } break; } @@ -2537,7 +2539,7 @@ namespace QobuzDownloaderX if (System.IO.File.Exists(checkFile)) { - output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackName + "\" already exists. Skipping.\r\n"))); + output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackName + "\" already exists. Skipping.\r\n"))); System.Threading.Thread.Sleep(100); continue; } @@ -2548,7 +2550,7 @@ namespace QobuzDownloaderX if (System.IO.File.Exists(checkFileVersion)) { - output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackName + " (" + versionName + ")" + "\" already exists. Skipping.\r\n"))); + output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackName + " (" + versionName + ")" + "\" already exists. Skipping.\r\n"))); System.Threading.Thread.Sleep(100); continue; } @@ -2956,6 +2958,695 @@ namespace QobuzDownloaderX #endregion + // For downloading "album" links + private async void downloadPlaylistBG_DoWork(object sender, DoWorkEventArgs e) + { + #region If URL has "playlist" + // Set "loc" as the selected path. + String loc = folderBrowserDialog.SelectedPath; + + // Create HttpClient to grab Album ID + var playlistIDClient = new HttpClient(); + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; + // Set user-agent to Firefox. + playlistIDClient.DefaultRequestHeaders.Add("User-Agent", userAgent); + // Set referer to localhost that mora qualitas uses + playlistIDClient.DefaultRequestHeaders.Add("Referer", "https://play.qobuz.com/playlist/" + albumId); + + // Empty output, then say Starting Downloads. + output.Invoke(new Action(() => output.Text = String.Empty)); + output.Invoke(new Action(() => output.AppendText("Starting Downloads...\r\n\r\n"))); + + try + { + // Grab response from Qobuz to get Track IDs from Album response. + var playlistIDUrl = "https://www.qobuz.com/api.json/0.2/playlist/get?playlist_id=" + albumId + "&extra=tracks&limit=10000&app_id=" + appid + "&user_auth_token=" + userAuth; + var playlistIDResponse = await playlistIDClient.GetAsync(playlistIDUrl); + string playlistIDResponseString = playlistIDResponse.Content.ReadAsStringAsync().Result; + + // Grab metadata from API JSON response + JObject joPlaylistResponse = JObject.Parse(playlistIDResponseString); + + string playlistName = (string)joPlaylistResponse["name"]; + string playlistNamePath = GetSafeFilename(playlistName); + + #region Availability Check (Valid Link?) + // Check if available at all. + string errorCheckPlaylist = (string)joPlaylistResponse["code"]; + string errorMessageCheck = (string)joPlaylistResponse["message"]; + + switch (errorCheckPlaylist) + { + case "404": + output.Invoke(new Action(() => output.Text = String.Empty)); + output.Invoke(new Action(() => output.AppendText("ERROR: 404\r\n"))); + output.Invoke(new Action(() => output.AppendText("Error message is \"" + errorMessageCheck + "\"\r\n"))); + output.Invoke(new Action(() => output.AppendText("This usually means the link is invalid, or isn't available in the region your account is from."))); + enableBoxes(sender, e); + return; + } + #endregion + + #region Playlist Art URL + // Grab playlist art link + try { playlistCoverImg = (string)joPlaylistResponse["image_rectangle"][0]; } catch { playlistCoverImg = null; } + #endregion + + // Grab all Track IDs listed on the API. + string trackIDsPattern = "\"isrc\":\"(?:.*?)\"(?:.*?)\"version\":(?:.*?),\"id\":(?.*?),"; + string trackIDsInput = playlistIDResponseString; + RegexOptions trackIDsOptions = RegexOptions.Multiline; + + foreach (Match m in Regex.Matches(trackIDsInput, trackIDsPattern, trackIDsOptions)) + { + // Grab matches for Track IDs + trackIdString = string.Format("{0}", m.Groups["trackId"].Value); + + // Create HttpClient to grab Track ID + var trackIDClient = new HttpClient(); + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; + // Set user-agent to Firefox. + trackIDClient.DefaultRequestHeaders.Add("User-Agent", userAgent); + // Set referer to localhost that mora qualitas uses + trackIDClient.DefaultRequestHeaders.Add("Referer", "https://play.qobuz.com/playlist/" + albumId); + + // Grab response from Qobuz to get info using Track IDs. + var trackIDUrl = "https://www.qobuz.com/api.json/0.2/track/get?track_id=" + trackIdString + "&app_id=" + appid + "&user_auth_token=" + userAuth; + var trackIDResponse = await trackIDClient.GetAsync(trackIDUrl); + string trackIDResponseString = trackIDResponse.Content.ReadAsStringAsync().Result; + + // Grab metadata from API JSON response + JObject joTrackResponse = JObject.Parse(trackIDResponseString); + + #region Availability Check (Track Avaialble?) + // Check if available at all. + string errorCheckTrack = (string)joTrackResponse["code"]; + string errorMessageCheckTrack = (string)joTrackResponse["message"]; + + switch (errorCheckTrack) + { + case "404": + output.Invoke(new Action(() => output.AppendText("Error 404, Skipping Track.\r\n"))); + continue; + } + #endregion + + #region Quality Info (Bitrate & Sample Rate) + // Grab sample rate and bit depth for album track is from. + var bitDepth = (string)joTrackResponse["maximum_bit_depth"]; + var sampleRate = (string)joTrackResponse["maximum_sampling_rate"]; + + var quality = "FLAC (" + bitDepth + "bit/" + sampleRate + "kHz)"; + var qualityPath = quality.Replace(@"\", "-").Replace(@"/", "-"); + + switch (formatIdString) + { + case "5": + quality = "MP3 320kbps CBR"; + qualityPath = "MP3"; + break; + case "6": + quality = "FLAC (16bit/44.1kHz)"; + qualityPath = "FLAC (16bit-44.1kHz)"; + break; + case "7": + if (quality == "FLAC (24bit/192kHz)") + { + quality = "FLAC (24bit/96kHz)"; + qualityPath = "FLAC (24bit-96kHz)"; + } + break; + } + + // Display album quality in quality textbox. + qualityTextbox.Invoke(new Action(() => qualityTextbox.Text = quality)); + #endregion + + #region Get Information (Tags, Titles, etc.) + // Reset troublesome strings (strings that stick around if new value is null) + composerName = null; + + // Grab cover art link + frontCoverImg = (string)joTrackResponse["album"]["image"]["large"]; + // Get 150x150 artwork for cover art box + frontCoverImgBox = frontCoverImg.Replace("_600.jpg", "_150.jpg"); + // Get max sized artwork + frontCoverImg = frontCoverImg.Replace("_600.jpg", "_max.jpg"); + albumArtPicBox.Invoke(new Action(() => albumArtPicBox.ImageLocation = frontCoverImgBox)); + + // Grab tag strings + albumArtist = (string)joTrackResponse["album"]["artist"]["name"]; albumArtist = DecodeEncodedNonAsciiCharacters(albumArtist); + albumArtistPath = GetSafeFilename(albumArtist); + albumArtistTextBox.Invoke(new Action(() => albumArtistTextBox.Text = albumArtist)); + + try + { + performerName = (string)joTrackResponse["performer"]["name"]; performerName = DecodeEncodedNonAsciiCharacters(performerName); + performerNamePath = GetSafeFilename(performerName); + } + catch { performerName = null; performerNamePath = null; /*Set to null and Ignore if fails*/ } + + try { composerName = (string)joTrackResponse["composer"]["name"]; composerName = DecodeEncodedNonAsciiCharacters(composerName); } catch { composerName = null; /*Set to null and Ignore if fails*/ } + + advisory = (string)joTrackResponse["parental_warning"]; + + albumName = (string)joTrackResponse["album"]["title"]; albumName = DecodeEncodedNonAsciiCharacters(albumName); + albumNamePath = GetSafeFilename(albumName); + albumTextBox.Invoke(new Action(() => albumTextBox.Text = albumName)); + + trackName = (string)joTrackResponse["title"]; trackName = trackName.Trim(); trackName = DecodeEncodedNonAsciiCharacters(trackName); + trackNamePath = GetSafeFilename(trackName); + + versionName = (string)joTrackResponse["version"]; + if (versionName != null) + { + versionName = DecodeEncodedNonAsciiCharacters(versionName); + versionNamePath = GetSafeFilename(versionName); + } + + genre = (string)joTrackResponse["album"]["genre"]["name"]; genre = DecodeEncodedNonAsciiCharacters(genre); + + releaseDate = (string)joTrackResponse["album"]["release_date_stream"]; + releaseDateTextBox.Invoke(new Action(() => releaseDateTextBox.Text = releaseDate)); + + copyright = (string)joTrackResponse["copyright"]; copyright = DecodeEncodedNonAsciiCharacters(copyright); + + upc = (string)joTrackResponse["album"]["upc"]; + upcTextBox.Invoke(new Action(() => upcTextBox.Text = upc)); + + isrc = (string)joTrackResponse["isrc"]; + + type = (string)joTrackResponse["album"]["release_type"]; + + // Grab tag ints + trackNumber = (int)joTrackResponse["track_number"]; + + trackTotal = (int)joTrackResponse["album"]["tracks_count"]; + totalTracksTextbox.Invoke(new Action(() => totalTracksTextbox.Text = trackTotal.ToString())); + + discNumber = (int)joTrackResponse["media_number"]; + + discTotal = (int)joTrackResponse["album"]["media_count"]; + + // Debug output to make sure values are grabbed properly + //output.Invoke(new Action(() => output.AppendText("Tags found, listed below...\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Album Artist - " + albumArtist + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Track Artist - " + performerName + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Composer - " + composerName + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Advisory - " + advisory + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Album Name - " + albumName + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Track Name - " + trackName + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Track Version - " + versionName + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Genre - " + genre + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Release Date - " + releaseDate + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Copyright - " + copyright + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" UPC - " + upc + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" ISRC - " + isrc + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Media Type - " + type + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Track Number - " + trackNumber.ToString() + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Track Total - " + trackTotal.ToString() + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Disc Number - " + discNumber.ToString() + "\r\n"))); + //output.Invoke(new Action(() => output.AppendText(" Disc Total - " + discTotal.ToString() + "\r\n"))); + + #region Availability Check (Streamable?) + // Check if available for streaming. + string streamCheck = (string)joTrackResponse["streamable"]; + + switch (streamCheck.ToLower()) + { + case "true": + break; + default: + switch (streamableCheckbox.Checked) + { + case true: + output.Invoke(new Action(() => output.AppendText("Track " + trackNumber.ToString() + " is not available for streaming. Unable to download.\r\n"))); + System.Threading.Thread.Sleep(100); + enableBoxes(sender, e); + continue; + default: + output.Invoke(new Action(() => output.AppendText("Track " + trackNumber.ToString() + "is not available for streaming. But stremable check is being ignored for debugging, or messed up releases. Attempting to download...\r\n"))); + break; + } + break; + } + #endregion + + #endregion + + #region Create Shortened Strings + // If name goes over 36 characters, limit it to 36 + if (albumArtistPath.Length > MaxLength) + { + albumArtistPath = albumArtistPath.Substring(0, MaxLength).TrimEnd(); + } + + if (performerName != null) + { + if (performerNamePath.Length > MaxLength) + { + performerNamePath = performerNamePath.Substring(0, MaxLength).TrimEnd(); + } + } + + if (playlistNamePath.Length > MaxLength) + { + playlistNamePath = playlistNamePath.Substring(0, MaxLength).TrimEnd(); + } + #endregion + + #region Create Directories + // Create strings for disc folders + string discFolder = null; + + // Create directories + string[] path1 = { loc, "- Playlists" }; + path1Full = Path.Combine(path1); + string[] path2 = { loc, "- Playlists", playlistNamePath }; + path2Full = Path.Combine(path2); + string[] path3 = { loc, "- Playlists", playlistNamePath, qualityPath }; + path3Full = Path.Combine(path3); + + path4Full = path3Full; + + System.IO.Directory.CreateDirectory(path1Full); + System.IO.Directory.CreateDirectory(path2Full); + System.IO.Directory.CreateDirectory(path3Full); + System.IO.Directory.CreateDirectory(path4Full); + + // Set albumPath to the created directories. + string trackPath = path4Full; + #endregion + + #region Create Shortened Strings (Again) + // Create final shortened track file names to avoid errors with file names being too long. + switch (versionName) + { + case null: + if ((performerNamePath + " - " + trackNamePath).Length > MaxLength) + { + finalTrackNamePath = (performerNamePath + " - " + trackNamePath).Substring(0, MaxLength).TrimEnd(); + } + else + { + finalTrackNamePath = (performerNamePath + " - " + trackNamePath).TrimEnd(); + } + break; + default: + if ((performerNamePath + " - " + trackNamePath + " (" + versionNamePath + ")").Length > MaxLength) + { + finalTrackNameVersionPath = (performerNamePath + " - " + trackNamePath + " (" + versionNamePath + ")").Substring(0, MaxLength).TrimEnd(); + } + else + { + finalTrackNameVersionPath = (performerNamePath + " - " + trackNamePath + " (" + versionNamePath + ")").TrimEnd(); + } + break; + } + #endregion + + #region Check if File Exists + // Check if there is a version name. + switch (versionName) + { + case null: + string[] path5 = { trackPath, finalTrackNamePath + audioFileType }; + string checkFile = Path.Combine(path5); + + if (System.IO.File.Exists(checkFile)) + { + output.Invoke(new Action(() => output.AppendText("File for \"" + performerNamePath + " - " + trackName + "\" already exists. Skipping.\r\n"))); + System.Threading.Thread.Sleep(100); + continue; + } + break; + default: + string[] path5Version = { trackPath, finalTrackNameVersionPath + audioFileType }; + string checkFileVersion = Path.Combine(path5Version); + + if (System.IO.File.Exists(checkFileVersion)) + { + output.Invoke(new Action(() => output.AppendText("File for \"" + performerNamePath + " - " + trackName + " (" + versionName + ")" + "\" already exists. Skipping.\r\n"))); + System.Threading.Thread.Sleep(100); + continue; + } + break; + } + #endregion + + // Create streaming URL. + createURL(sender, e); + + try + { + #region Downloading + // Check if there is a version name. + switch (versionName) + { + case null: + output.Invoke(new Action(() => output.AppendText("Downloading - " + performerName + " - " + trackName + " ......"))); + break; + default: + output.Invoke(new Action(() => output.AppendText("Downloading - " + performerName + " - " + trackName + " (" + versionName + ")" + " ......"))); + break; + } + + // Save streamed file from link + using (HttpClient streamClient = new HttpClient()) + { + // Set "range" header to nearly unlimited. + streamClient.DefaultRequestHeaders.Range = new RangeHeaderValue(0, 999999999999); + // Set user-agent to Firefox. + streamClient.DefaultRequestHeaders.Add("User-Agent", userAgent); + // Set referer URL to album ID. + streamClient.DefaultRequestHeaders.Add("Referer", "https://play.qobuz.com/playlist/" + albumId); + + using (HttpResponseMessage streamResponse = await streamClient.GetAsync(stream, HttpCompletionOption.ResponseHeadersRead)) + using (Stream streamToReadFrom = await streamResponse.Content.ReadAsStreamAsync()) + { + string fileName = Path.GetTempFileName(); + using (Stream streamToWriteTo = System.IO.File.Open(fileName, FileMode.Create)) + { + await streamToReadFrom.CopyToAsync(streamToWriteTo); + } + + switch (versionName) + { + case null: + string[] path6 = { trackPath, finalTrackNamePath + audioFileType }; + string filePath = Path.Combine(path6); + + System.IO.File.Move(fileName, filePath); + break; + default: + string[] path6Version = { trackPath, finalTrackNameVersionPath + audioFileType }; + string filePathVersion = Path.Combine(path6Version); + + System.IO.File.Move(fileName, filePathVersion); + break; + } + } + } + #endregion + + #region Cover Art Saving + string[] path7 = { loc, "- Playlists", playlistNamePath, "Playlist.jpg" }; + string coverArtPath = Path.Combine(path7); + string[] path7Tag = { loc, "- Playlists", playlistNamePath, qualityPath, artSize + ".jpg" }; + string coverArtTagPath = Path.Combine(path7Tag); + + if (System.IO.File.Exists(coverArtPath)) + { + try + { + // Skip, don't re-download. + + // Download selected cover art size for tagging files (happens every time a track is downloaded). + using (WebClient imgClient = new WebClient()) + { + imgClient.DownloadFile(new Uri(frontCoverImg.Replace("_max", "_" + artSize)), coverArtTagPath); + } + } + catch + { + // Ignore, Qobuz servers throw a 404 as if the image doesn't exist. + } + } + else + { + try + { + // Save cover art to selected path. + using (WebClient imgClient = new WebClient()) + { + // Download selected cover art size for tagging files (happens every time a track is downloaded). + imgClient.DownloadFile(new Uri(frontCoverImg.Replace("_max", "_" + artSize)), coverArtTagPath); + + // Download max quality Cover Art to "Playlist.jpg" file in chosen path. + imgClient.DownloadFile(new Uri(playlistCoverImg), coverArtPath); + } + } + catch + { + // Ignore, Qobuz servers throw a 404 as if the image doesn't exist. + } + } + #endregion + + #region Tagging + switch (versionName) + { + case null: + break; + default: + finalTrackNamePath = finalTrackNameVersionPath; + break; + } + + string[] path8 = { trackPath, finalTrackNamePath + audioFileType }; + string tagFilePath = Path.Combine(path8); + string[] path9 = { loc, "- Playlists", playlistNamePath, qualityPath, artSize + ".jpg" }; + string tagCoverArtFilePath = Path.Combine(path9); + + // Set file to tag + var tfile = TagLib.File.Create(tagFilePath); + + switch (audioFileType) + { + case ".mp3": + #region MP3 Tagging + // For custom / troublesome tags. + TagLib.Id3v2.Tag t = (TagLib.Id3v2.Tag)tfile.GetTag(TagLib.TagTypes.Id3v2); + + // Saving cover art to file(s) + if (imageCheckbox.Checked == true) + { + try + { + // Define cover art to use for MP3 file(s) + TagLib.Id3v2.AttachedPictureFrame pic = new TagLib.Id3v2.AttachedPictureFrame(); + pic.TextEncoding = TagLib.StringType.Latin1; + pic.MimeType = System.Net.Mime.MediaTypeNames.Image.Jpeg; + pic.Type = TagLib.PictureType.FrontCover; + pic.Data = TagLib.ByteVector.FromPath(tagCoverArtFilePath); + + // Save cover art to MP3 file. + tfile.Tag.Pictures = new TagLib.IPicture[1] { pic }; + tfile.Save(); + } + catch + { + output.Invoke(new Action(() => output.AppendText("Cover art tag fail, .jpg still exists?..."))); + } + } + + // Track Title tag + if (trackTitleCheckbox.Checked == true) + { + switch (versionName) + { + case null: + tfile.Tag.Title = trackName; + break; + default: + tfile.Tag.Title = trackName + " (" + versionName + ")"; + break; + } + + } + + // Album Title tag + if (albumCheckbox.Checked == true) { tfile.Tag.Album = albumName; } + + // Album Artits tag + if (albumArtistCheckbox.Checked == true) { tfile.Tag.AlbumArtists = new string[] { albumArtist }; } + + // Track Artist tag + if (artistCheckbox.Checked == true) { tfile.Tag.Performers = new string[] { performerName }; } + + // Composer tag + if (composerCheckbox.Checked == true) { tfile.Tag.Composers = new string[] { composerName }; } + + // Release Date tag + if (releaseCheckbox.Checked == true) { releaseDate = releaseDate.Substring(0, 4); tfile.Tag.Year = UInt32.Parse(releaseDate); } + + // Genre tag + if (genreCheckbox.Checked == true) { tfile.Tag.Genres = new string[] { genre }; } + + // Track Number tag + if (trackNumberCheckbox.Checked == true) { tfile.Tag.Track = Convert.ToUInt32(trackNumber); } + + // Disc Number tag + if (discNumberCheckbox.Checked == true) { tfile.Tag.Disc = Convert.ToUInt32(discNumber); } + + // Total Discs tag + if (discTotalCheckbox.Checked == true) { tfile.Tag.DiscCount = Convert.ToUInt32(discTotal); } + + // Total Tracks tag + if (trackTotalCheckbox.Checked == true) { tfile.Tag.TrackCount = Convert.ToUInt32(trackTotal); } + + // Comment tag + if (commentCheckbox.Checked == true) { tfile.Tag.Comment = commentTextbox.Text; } + + // Copyright tag + if (copyrightCheckbox.Checked == true) { tfile.Tag.Copyright = copyright; } + + // ISRC tag + if (isrcCheckbox.Checked == true) { TagLib.Id3v2.Tag tag = (TagLib.Id3v2.Tag)tfile.GetTag(TagTypes.Id3v2, true); tag.SetTextFrame("TSRC", isrc); } + + // Release Type tag + if (type != null) + { + if (typeCheckbox.Checked == true) { TagLib.Id3v2.Tag tag = (TagLib.Id3v2.Tag)tfile.GetTag(TagTypes.Id3v2, true); tag.SetTextFrame("TMED", type); } + } + + // Save all selected tags to file + tfile.Save(); + #endregion + break; + case ".flac": + #region FLAC Tagging + // For custom / troublesome tags. + var custom = (TagLib.Ogg.XiphComment)tfile.GetTag(TagLib.TagTypes.Xiph); + + // Saving cover art to file(s) + if (imageCheckbox.Checked == true) + { + try + { + // Define cover art to use for FLAC file(s) + TagLib.Id3v2.AttachedPictureFrame pic = new TagLib.Id3v2.AttachedPictureFrame(); + pic.TextEncoding = TagLib.StringType.Latin1; + pic.MimeType = System.Net.Mime.MediaTypeNames.Image.Jpeg; + pic.Type = TagLib.PictureType.FrontCover; + pic.Data = TagLib.ByteVector.FromPath(tagCoverArtFilePath); + + // Save cover art to FLAC file. + tfile.Tag.Pictures = new TagLib.IPicture[1] { pic }; + tfile.Save(); + } + catch + { + output.Invoke(new Action(() => output.AppendText("Cover art tag fail, .jpg still exists?..."))); + } + } + + // Track Title tag + if (trackTitleCheckbox.Checked == true) + { + switch (versionName) + { + case null: + tfile.Tag.Title = trackName; + break; + default: + tfile.Tag.Title = trackName + " (" + versionName + ")"; + break; + } + } + + // Album Title tag + if (albumCheckbox.Checked == true) { tfile.Tag.Album = albumName; } + + // Album Artits tag + if (albumArtistCheckbox.Checked == true) { custom.SetField("ALBUMARTIST", new string[] { albumArtist }); } + + // Track Artist tag + if (artistCheckbox.Checked == true) { custom.SetField("ARTIST", new string[] { performerName }); } + + // Composer tag + if (composerCheckbox.Checked == true) { custom.SetField("COMPOSER", new string[] { composerName }); } + + // Release Date tag + if (releaseCheckbox.Checked == true) { custom.SetField("YEAR", new string[] { releaseDate }); } + + // Genre tag + if (genreCheckbox.Checked == true) { custom.SetField("GENRE", new string[] { genre }); } + + // Track Number tag + if (trackNumberCheckbox.Checked == true) { tfile.Tag.Track = Convert.ToUInt32(trackNumber); } + + // Disc Number tag + if (discNumberCheckbox.Checked == true) { tfile.Tag.Disc = Convert.ToUInt32(discNumber); } + + // Total Discs tag + if (discTotalCheckbox.Checked == true) { tfile.Tag.DiscCount = Convert.ToUInt32(discTotal); } + + // Total Tracks tag + if (trackTotalCheckbox.Checked == true) { tfile.Tag.TrackCount = Convert.ToUInt32(trackTotal); } + + // Comment tag + if (commentCheckbox.Checked == true) { custom.SetField("COMMENT", new string[] { commentTextbox.Text }); } + + // Copyright tag + if (copyrightCheckbox.Checked == true) { custom.SetField("COPYRIGHT", new string[] { copyright }); } + // UPC tag + if (upcCheckbox.Checked == true) { custom.SetField("UPC", new string[] { upc }); } + + // ISRC tag + if (isrcCheckbox.Checked == true) { custom.SetField("ISRC", new string[] { isrc }); } + + // Release Type tag + if (type != null) + { + if (typeCheckbox.Checked == true) { custom.SetField("MEDIATYPE", new string[] { type }); } + } + + // Explicit tag + if (explicitCheckbox.Checked == true) + { + if (advisory == "false") { custom.SetField("ITUNESADVISORY", new string[] { "0" }); } else { custom.SetField("ITUNESADVISORY", new string[] { "1" }); } + } + + // Save all selected tags to file + tfile.Save(); + #endregion + break; + } + #endregion + } + catch (Exception downloadError) + { + // If there is an issue trying to, or during the download, show error info. + string error = downloadError.ToString(); + output.Invoke(new Action(() => output.AppendText("\r\n\r\n"))); + output.Invoke(new Action(() => output.AppendText("Track Download ERROR. Information below.\r\n\r\n"))); + output.Invoke(new Action(() => output.AppendText(error))); + enableBoxes(sender, e); + return; + } + + // Delete image file used for tagging + string[] path12 = { loc, "- Playlists", playlistNamePath, qualityPath, artSize + ".jpg" }; + string coverArtTagDelete = Path.Combine(path12); + + if (System.IO.File.Exists(coverArtTagDelete)) + { + System.IO.File.Delete(coverArtTagDelete); + } + + // Say when a track is done downloading, then wait for the next track / end. + output.Invoke(new Action(() => output.AppendText("Track Download Done!\r\n"))); + System.Threading.Thread.Sleep(100); + } + + // Say that downloading is completed. + output.Invoke(new Action(() => output.AppendText("\r\n\r\n"))); + output.Invoke(new Action(() => output.AppendText("Downloading job completed! All downloaded files will be located in your chosen path."))); + enableBoxes(sender, e); + } + catch (Exception ex) + { + string error = ex.ToString(); + //output.Invoke(new Action(() => output.Text = String.Empty)); + output.Invoke(new Action(() => output.AppendText("Failed to download (First Phase). Error information below.\r\n\r\n"))); + output.Invoke(new Action(() => output.AppendText(error))); + enableBoxes(sender, e); + return; + } + #endregion + } + // For downloading "album" links private async void downloadAlbumBG_DoWork(object sender, DoWorkEventArgs e) { @@ -3278,23 +3969,23 @@ namespace QobuzDownloaderX switch (versionName) { case null: - if ((trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).Length > MaxLength) + if ((trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).Length > MaxLength) { - finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).Substring(0, MaxLength).TrimEnd(); + finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).Substring(0, MaxLength).TrimEnd(); } else { - finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).TrimEnd(); + finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).TrimEnd(); } break; default: - if ((trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").Length > MaxLength) + if ((trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").Length > MaxLength) { - finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").Substring(0, MaxLength).TrimEnd(); + finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").Substring(0, MaxLength).TrimEnd(); } else { - finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").TrimEnd(); + finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").TrimEnd(); } break; } @@ -3310,7 +4001,7 @@ namespace QobuzDownloaderX if (System.IO.File.Exists(checkFile)) { - output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackName + "\" already exists. Skipping.\r\n"))); + output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackName + "\" already exists. Skipping.\r\n"))); System.Threading.Thread.Sleep(100); continue; } @@ -3321,7 +4012,7 @@ namespace QobuzDownloaderX if (System.IO.File.Exists(checkFileVersion)) { - output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackName + " (" + versionName + ")" + "\" already exists. Skipping.\r\n"))); + output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackName + " (" + versionName + ")" + "\" already exists. Skipping.\r\n"))); System.Threading.Thread.Sleep(100); continue; } @@ -4001,23 +4692,23 @@ namespace QobuzDownloaderX switch (versionName) { case null: - if ((trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).Length > MaxLength) + if ((trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).Length > MaxLength) { - finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).Substring(0, MaxLength).TrimEnd(); + finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).Substring(0, MaxLength).TrimEnd(); } else { - finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath).TrimEnd(); + finalTrackNamePath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath).TrimEnd(); } break; default: - if ((trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").Length > MaxLength) + if ((trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").Length > MaxLength) { - finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").Substring(0, MaxLength).TrimEnd(); + finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").Substring(0, MaxLength).TrimEnd(); } else { - finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackNamePath + " (" + versionNamePath + ")").TrimEnd(); + finalTrackNameVersionPath = (trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackNamePath + " (" + versionNamePath + ")").TrimEnd(); } break; } @@ -4033,7 +4724,7 @@ namespace QobuzDownloaderX if (System.IO.File.Exists(checkFile)) { - output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackName + "\" already exists. Skipping.\r\n"))); + output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackName + "\" already exists. Skipping.\r\n"))); System.Threading.Thread.Sleep(100); enableBoxes(sender, e); return; @@ -4045,7 +4736,7 @@ namespace QobuzDownloaderX if (System.IO.File.Exists(checkFileVersion)) { - output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + " " + trackName + " (" + versionName + ")" + "\" already exists. Skipping.\r\n"))); + output.Invoke(new Action(() => output.AppendText("File for \"" + trackNumber.ToString().PadLeft(paddingLength, '0') + fileNameTemplateString + trackName + " (" + versionName + ")" + "\" already exists. Skipping.\r\n"))); System.Threading.Thread.Sleep(100); enableBoxes(sender, e); return; @@ -4399,10 +5090,10 @@ namespace QobuzDownloaderX if (this.Height == 533) { //New Height - this.Height = 733; + this.Height = 632; tagsLabel.Text = "🠉 Choose which tags to save (click me) 🠉"; } - else if (this.Height == 733) + else if (this.Height == 632) { //New Height this.Height = 533; @@ -4533,6 +5224,27 @@ namespace QobuzDownloaderX Settings.Default.Save(); } + private void filenameTempSelect_SelectedIndexChanged(object sender, EventArgs e) + { + // Set filename template to selected value, and save selected option to settings. + if (filenameTempSelect.SelectedIndex == 0) + { + fileNameTemplateString = " "; + } + else if (filenameTempSelect.SelectedIndex == 1) + { + fileNameTemplateString = " - "; + } + else + { + fileNameTemplateString = " "; + } + + Settings.Default.savedFilenameTemplate = filenameTempSelect.SelectedIndex; + Settings.Default.savedFilenameTemplateString = fileNameTemplateString; + Settings.Default.Save(); + } + private void maxLengthTextbox_TextChanged(object sender, EventArgs e) { if (maxLengthTextbox.Text != null) @@ -4570,6 +5282,7 @@ namespace QobuzDownloaderX if (flacHighCheckbox.Checked == true) { formatIdString = "27"; + customFormatIDTextbox.Text = "27"; audioFileType = ".flac"; Settings.Default.qualityFormat = formatIdString; Settings.Default.audioType = audioFileType; @@ -4595,6 +5308,7 @@ namespace QobuzDownloaderX if (flacMidCheckbox.Checked == true) { formatIdString = "7"; + customFormatIDTextbox.Text = "7"; audioFileType = ".flac"; Settings.Default.qualityFormat = formatIdString; Settings.Default.audioType = audioFileType; @@ -4620,6 +5334,7 @@ namespace QobuzDownloaderX if (flacLowCheckbox.Checked == true) { formatIdString = "6"; + customFormatIDTextbox.Text = "6"; audioFileType = ".flac"; Settings.Default.qualityFormat = formatIdString; Settings.Default.audioType = audioFileType; @@ -4645,6 +5360,7 @@ namespace QobuzDownloaderX if (mp3Checkbox.Checked == true) { formatIdString = "5"; + customFormatIDTextbox.Text = "5"; audioFileType = ".mp3"; Settings.Default.qualityFormat = formatIdString; Settings.Default.audioType = audioFileType; @@ -4661,6 +5377,14 @@ namespace QobuzDownloaderX } } } + + private void customFormatIDTextbox_TextChanged(object sender, EventArgs e) + { + if (formatIdString != "5" || formatIdString != "6" || formatIdString != "7" || formatIdString != "27") + { + formatIdString = customFormatIDTextbox.Text; + } + } #endregion #region Form moving, closing, minimizing, etc. @@ -4745,6 +5469,9 @@ namespace QobuzDownloaderX displaySecretButton.Visible = true; secretTextbox.Visible = true; hiddenTextPanel.Visible = true; + customFormatIDTextbox.Visible = true; + customFormatPanel.Visible = true; + formatIDLabel.Visible = true; } else { @@ -4754,6 +5481,9 @@ namespace QobuzDownloaderX hiddenTextPanel.Visible = false; enableBtnsButton.Visible = false; hideDebugButton.Visible = false; + customFormatIDTextbox.Visible = false; + customFormatPanel.Visible = false; + formatIDLabel.Visible = false; } } @@ -4765,6 +5495,9 @@ namespace QobuzDownloaderX hiddenTextPanel.Visible = false; enableBtnsButton.Visible = false; hideDebugButton.Visible = false; + customFormatIDTextbox.Visible = false; + customFormatPanel.Visible = false; + formatIDLabel.Visible = false; devClickEggThingValue = 0; } diff --git a/QobuzDownloaderX/Form1.resx b/QobuzDownloaderX/Form1.resx index 0c6fece..e3985e5 100644 --- a/QobuzDownloaderX/Form1.resx +++ b/QobuzDownloaderX/Form1.resx @@ -144,6 +144,9 @@ 1229, 13 + + 17, 52 + diff --git a/QobuzDownloaderX/LoginForm-v2.cs b/QobuzDownloaderX/LoginForm-v2.cs index 3edda85..137d4b6 100644 --- a/QobuzDownloaderX/LoginForm-v2.cs +++ b/QobuzDownloaderX/LoginForm-v2.cs @@ -370,6 +370,7 @@ namespace QobuzDownloaderX getSecretBG.WorkerSupportsCancellation = true; WebClient bundleURLClient = new WebClient(); + bundleURLClient.Proxy = null; string bundleHTML = bundleURLClient.DownloadString("https://play.qobuz.com/login"); // Grab link to bundle.js @@ -452,8 +453,6 @@ namespace QobuzDownloaderX ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; //Make connection secure loginClient.DefaultRequestHeaders.Add("Authorization", "Basic WlRKbE9XTmhaR1V0TnpsbVpTMDBaR1UyTFRrd1lqTXRaRGsxT0RSbE1Ea3dPRE01Ok1UUmpaVFZqTTJFdE9HVmxaaTAwT1RVM0xXRm1Oamt0TlRsbE9ERmhObVl5TnpJNQ=="); //This value is from logging in to the Napster Android app. - - // Create HttpClient to grab Track ID var loginClient2 = new HttpClient(); // Run through TLS to allow secure connection. diff --git a/QobuzDownloaderX/Properties/AssemblyInfo.cs b/QobuzDownloaderX/Properties/AssemblyInfo.cs index 20925d6..f76eb9e 100644 --- a/QobuzDownloaderX/Properties/AssemblyInfo.cs +++ b/QobuzDownloaderX/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.9.9.21")] -[assembly: AssemblyFileVersion("0.9.9.21")] +[assembly: AssemblyVersion("0.9.9.22")] +[assembly: AssemblyFileVersion("0.9.9.22")] diff --git a/QobuzDownloaderX/Properties/Settings.Designer.cs b/QobuzDownloaderX/Properties/Settings.Designer.cs index 05c6519..77c0a98 100644 --- a/QobuzDownloaderX/Properties/Settings.Designer.cs +++ b/QobuzDownloaderX/Properties/Settings.Designer.cs @@ -454,5 +454,29 @@ namespace QobuzDownloaderX.Properties { this["savedMaxLength"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("1")] + public int savedFilenameTemplate { + get { + return ((int)(this["savedFilenameTemplate"])); + } + set { + this["savedFilenameTemplate"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string savedFilenameTemplateString { + get { + return ((string)(this["savedFilenameTemplateString"])); + } + set { + this["savedFilenameTemplateString"] = value; + } + } } } diff --git a/QobuzDownloaderX/Properties/Settings.settings b/QobuzDownloaderX/Properties/Settings.settings index 1ea3388..e825adf 100644 --- a/QobuzDownloaderX/Properties/Settings.settings +++ b/QobuzDownloaderX/Properties/Settings.settings @@ -110,5 +110,11 @@ 36 + + 1 + + + + \ No newline at end of file