mirror of
				https://github.com/NohamR/QobuzDownloaderX.git
				synced 2025-10-30 21:59:31 +00:00 
			
		
		
		
	0.9.9.17
0.9.9.17
This commit is contained in:
		
							parent
							
								
									bb30ed6deb
								
							
						
					
					
						commit
						7fee36c600
					
				
							
								
								
									
										178
									
								
								QobuzDownloaderX/AboutForm.Designer.cs
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										178
									
								
								QobuzDownloaderX/AboutForm.Designer.cs
									
									
									
										generated
									
									
									
										Normal file
									
								
							| @ -0,0 +1,178 @@ | |||||||
|  | namespace QobuzDownloaderX | ||||||
|  | { | ||||||
|  |     partial class AboutForm | ||||||
|  |     { | ||||||
|  |         /// <summary> | ||||||
|  |         /// Required designer variable. | ||||||
|  |         /// </summary> | ||||||
|  |         private System.ComponentModel.IContainer components = null; | ||||||
|  | 
 | ||||||
|  |         /// <summary> | ||||||
|  |         /// Clean up any resources being used. | ||||||
|  |         /// </summary> | ||||||
|  |         /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | ||||||
|  |         protected override void Dispose(bool disposing) | ||||||
|  |         { | ||||||
|  |             if (disposing && (components != null)) | ||||||
|  |             { | ||||||
|  |                 components.Dispose(); | ||||||
|  |             } | ||||||
|  |             base.Dispose(disposing); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         #region Windows Form Designer generated code | ||||||
|  | 
 | ||||||
|  |         /// <summary> | ||||||
|  |         /// Required method for Designer support - do not modify | ||||||
|  |         /// the contents of this method with the code editor. | ||||||
|  |         /// </summary> | ||||||
|  |         private void InitializeComponent() | ||||||
|  |         { | ||||||
|  |             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm)); | ||||||
|  |             this.panel1 = new System.Windows.Forms.Panel(); | ||||||
|  |             this.verNumLabel2 = new System.Windows.Forms.Label(); | ||||||
|  |             this.exitLabel = new System.Windows.Forms.Label(); | ||||||
|  |             this.pictureBox1 = new System.Windows.Forms.PictureBox(); | ||||||
|  |             this.devLabel = new System.Windows.Forms.Label(); | ||||||
|  |             this.label1 = new System.Windows.Forms.Label(); | ||||||
|  |             this.label2 = new System.Windows.Forms.Label(); | ||||||
|  |             this.label3 = new System.Windows.Forms.Label(); | ||||||
|  |             this.panel1.SuspendLayout(); | ||||||
|  |             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); | ||||||
|  |             this.SuspendLayout(); | ||||||
|  |             //  | ||||||
|  |             // panel1 | ||||||
|  |             //  | ||||||
|  |             this.panel1.BackgroundImage = global::QobuzDownloaderX.Properties.Resources.login_frame; | ||||||
|  |             this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; | ||||||
|  |             this.panel1.Controls.Add(this.exitLabel); | ||||||
|  |             this.panel1.Controls.Add(this.pictureBox1); | ||||||
|  |             this.panel1.Dock = System.Windows.Forms.DockStyle.Top; | ||||||
|  |             this.panel1.Location = new System.Drawing.Point(0, 0); | ||||||
|  |             this.panel1.Name = "panel1"; | ||||||
|  |             this.panel1.Size = new System.Drawing.Size(365, 95); | ||||||
|  |             this.panel1.TabIndex = 1; | ||||||
|  |             this.panel1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.panel1_MouseMove); | ||||||
|  |             //  | ||||||
|  |             // verNumLabel2 | ||||||
|  |             //  | ||||||
|  |             this.verNumLabel2.BackColor = System.Drawing.Color.Transparent; | ||||||
|  |             this.verNumLabel2.Font = new System.Drawing.Font("Trebuchet MS", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); | ||||||
|  |             this.verNumLabel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); | ||||||
|  |             this.verNumLabel2.Location = new System.Drawing.Point(12, 98); | ||||||
|  |             this.verNumLabel2.Name = "verNumLabel2"; | ||||||
|  |             this.verNumLabel2.Size = new System.Drawing.Size(341, 18); | ||||||
|  |             this.verNumLabel2.TabIndex = 32; | ||||||
|  |             this.verNumLabel2.Text = "#.#.#.#"; | ||||||
|  |             this.verNumLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; | ||||||
|  |             this.verNumLabel2.MouseMove += new System.Windows.Forms.MouseEventHandler(this.verNumLabel2_MouseMove); | ||||||
|  |             //  | ||||||
|  |             // exitLabel | ||||||
|  |             //  | ||||||
|  |             this.exitLabel.AutoSize = true; | ||||||
|  |             this.exitLabel.BackColor = System.Drawing.Color.Transparent; | ||||||
|  |             this.exitLabel.Font = new System.Drawing.Font("Calibri", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); | ||||||
|  |             this.exitLabel.ForeColor = System.Drawing.Color.Black; | ||||||
|  |             this.exitLabel.Location = new System.Drawing.Point(345, 0); | ||||||
|  |             this.exitLabel.Name = "exitLabel"; | ||||||
|  |             this.exitLabel.Size = new System.Drawing.Size(20, 23); | ||||||
|  |             this.exitLabel.TabIndex = 9; | ||||||
|  |             this.exitLabel.Text = "X"; | ||||||
|  |             this.exitLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter; | ||||||
|  |             this.exitLabel.Click += new System.EventHandler(this.exitLabel_Click); | ||||||
|  |             //  | ||||||
|  |             // pictureBox1 | ||||||
|  |             //  | ||||||
|  |             this.pictureBox1.BackColor = System.Drawing.Color.Transparent; | ||||||
|  |             this.pictureBox1.Image = global::QobuzDownloaderX.Properties.Resources.qbdlx_white; | ||||||
|  |             this.pictureBox1.Location = new System.Drawing.Point(53, 12); | ||||||
|  |             this.pictureBox1.Name = "pictureBox1"; | ||||||
|  |             this.pictureBox1.Size = new System.Drawing.Size(258, 64); | ||||||
|  |             this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; | ||||||
|  |             this.pictureBox1.TabIndex = 29; | ||||||
|  |             this.pictureBox1.TabStop = false; | ||||||
|  |             this.pictureBox1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox1_MouseMove); | ||||||
|  |             //  | ||||||
|  |             // devLabel | ||||||
|  |             //  | ||||||
|  |             this.devLabel.AutoSize = true; | ||||||
|  |             this.devLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); | ||||||
|  |             this.devLabel.Location = new System.Drawing.Point(140, 131); | ||||||
|  |             this.devLabel.Name = "devLabel"; | ||||||
|  |             this.devLabel.Size = new System.Drawing.Size(84, 13); | ||||||
|  |             this.devLabel.TabIndex = 34; | ||||||
|  |             this.devLabel.Text = "Developer - AiiR"; | ||||||
|  |             //  | ||||||
|  |             // label1 | ||||||
|  |             //  | ||||||
|  |             this.label1.AutoSize = true; | ||||||
|  |             this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); | ||||||
|  |             this.label1.Location = new System.Drawing.Point(79, 154); | ||||||
|  |             this.label1.Name = "label1"; | ||||||
|  |             this.label1.Size = new System.Drawing.Size(207, 13); | ||||||
|  |             this.label1.TabIndex = 35; | ||||||
|  |             this.label1.Text = "Inspired By - Qo-DL by Sorrow and DashLt"; | ||||||
|  |             this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; | ||||||
|  |             //  | ||||||
|  |             // label2 | ||||||
|  |             //  | ||||||
|  |             this.label2.AutoSize = true; | ||||||
|  |             this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); | ||||||
|  |             this.label2.Location = new System.Drawing.Point(47, 177); | ||||||
|  |             this.label2.Name = "label2"; | ||||||
|  |             this.label2.Size = new System.Drawing.Size(271, 26); | ||||||
|  |             this.label2.TabIndex = 36; | ||||||
|  |             this.label2.Text = "Thanks to the users on Github and Telegram for offering\r\nbug reports and ideas!"; | ||||||
|  |             this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; | ||||||
|  |             //  | ||||||
|  |             // label3 | ||||||
|  |             //  | ||||||
|  |             this.label3.AutoSize = true; | ||||||
|  |             this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(88)))), ((int)(((byte)(92)))), ((int)(((byte)(102))))); | ||||||
|  |             this.label3.Location = new System.Drawing.Point(15, 237); | ||||||
|  |             this.label3.Name = "label3"; | ||||||
|  |             this.label3.Size = new System.Drawing.Size(334, 26); | ||||||
|  |             this.label3.TabIndex = 37; | ||||||
|  |             this.label3.Text = "IF YOU PAID FOR THIS PROGRAM, YOU HAVE BEEN SCAMMED!\r\nTHIS SOFTWARE IS COMPLETELY" + | ||||||
|  |     " FREE AND OPEN-SOURCE."; | ||||||
|  |             this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; | ||||||
|  |             //  | ||||||
|  |             // AboutForm | ||||||
|  |             //  | ||||||
|  |             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(365, 289); | ||||||
|  |             this.Controls.Add(this.label3); | ||||||
|  |             this.Controls.Add(this.label2); | ||||||
|  |             this.Controls.Add(this.label1); | ||||||
|  |             this.Controls.Add(this.devLabel); | ||||||
|  |             this.Controls.Add(this.verNumLabel2); | ||||||
|  |             this.Controls.Add(this.panel1); | ||||||
|  |             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; | ||||||
|  |             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); | ||||||
|  |             this.Name = "AboutForm"; | ||||||
|  |             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; | ||||||
|  |             this.Text = "QobuzDLX | About"; | ||||||
|  |             this.Load += new System.EventHandler(this.AboutForm_Load); | ||||||
|  |             this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.AboutForm_MouseMove); | ||||||
|  |             this.panel1.ResumeLayout(false); | ||||||
|  |             this.panel1.PerformLayout(); | ||||||
|  |             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); | ||||||
|  |             this.ResumeLayout(false); | ||||||
|  |             this.PerformLayout(); | ||||||
|  | 
 | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         #endregion | ||||||
|  | 
 | ||||||
|  |         private System.Windows.Forms.Panel panel1; | ||||||
|  |         private System.Windows.Forms.Label verNumLabel2; | ||||||
|  |         private System.Windows.Forms.Label exitLabel; | ||||||
|  |         private System.Windows.Forms.PictureBox pictureBox1; | ||||||
|  |         private System.Windows.Forms.Label devLabel; | ||||||
|  |         private System.Windows.Forms.Label label1; | ||||||
|  |         private System.Windows.Forms.Label label2; | ||||||
|  |         private System.Windows.Forms.Label label3; | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										78
									
								
								QobuzDownloaderX/AboutForm.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								QobuzDownloaderX/AboutForm.cs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,78 @@ | |||||||
|  | using QobuzDownloaderX.Properties; | ||||||
|  | using System; | ||||||
|  | using System.Runtime.InteropServices; | ||||||
|  | using System.Collections.Generic; | ||||||
|  | using System.ComponentModel; | ||||||
|  | using System.Data; | ||||||
|  | using System.Drawing; | ||||||
|  | using System.Linq; | ||||||
|  | using System.Text; | ||||||
|  | using System.Threading.Tasks; | ||||||
|  | using System.Windows.Forms; | ||||||
|  | using System.Reflection; | ||||||
|  | 
 | ||||||
|  | namespace QobuzDownloaderX | ||||||
|  | { | ||||||
|  |     public partial class AboutForm : Form | ||||||
|  |     { | ||||||
|  |         public AboutForm() | ||||||
|  |         { | ||||||
|  |             InitializeComponent(); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         public const int WM_NCLBUTTONDOWN = 0xA1; | ||||||
|  |         public const int HT_CAPTION = 0x2; | ||||||
|  | 
 | ||||||
|  |         [DllImportAttribute("user32.dll")] | ||||||
|  |         public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); | ||||||
|  |         [DllImportAttribute("user32.dll")] | ||||||
|  |         public static extern bool ReleaseCapture(); | ||||||
|  | 
 | ||||||
|  |         private void AboutForm_Load(object sender, EventArgs e) | ||||||
|  |         { | ||||||
|  |             // Get and display version number. | ||||||
|  |             verNumLabel2.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString(); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         private void exitLabel_Click(object sender, EventArgs e) | ||||||
|  |         { | ||||||
|  |             this.Close(); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         private void panel1_MouseMove(object sender, MouseEventArgs e) | ||||||
|  |         { | ||||||
|  |             if (e.Button == MouseButtons.Left) | ||||||
|  |             { | ||||||
|  |                 ReleaseCapture(); | ||||||
|  |                 SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         private void pictureBox1_MouseMove(object sender, MouseEventArgs e) | ||||||
|  |         { | ||||||
|  |             if (e.Button == MouseButtons.Left) | ||||||
|  |             { | ||||||
|  |                 ReleaseCapture(); | ||||||
|  |                 SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         private void verNumLabel2_MouseMove(object sender, MouseEventArgs e) | ||||||
|  |         { | ||||||
|  |             if (e.Button == MouseButtons.Left) | ||||||
|  |             { | ||||||
|  |                 ReleaseCapture(); | ||||||
|  |                 SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         private void AboutForm_MouseMove(object sender, MouseEventArgs e) | ||||||
|  |         { | ||||||
|  |             if (e.Button == MouseButtons.Left) | ||||||
|  |             { | ||||||
|  |                 ReleaseCapture(); | ||||||
|  |                 SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										1052
									
								
								QobuzDownloaderX/AboutForm.resx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1052
									
								
								QobuzDownloaderX/AboutForm.resx
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										19
									
								
								QobuzDownloaderX/Form1.Designer.cs
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										19
									
								
								QobuzDownloaderX/Form1.Designer.cs
									
									
									
										generated
									
									
									
								
							| @ -106,6 +106,7 @@ | |||||||
|             this.artSizeSelect = new System.Windows.Forms.ComboBox(); |             this.artSizeSelect = new System.Windows.Forms.ComboBox(); | ||||||
|             this.artSizeLabel = new System.Windows.Forms.Label(); |             this.artSizeLabel = new System.Windows.Forms.Label(); | ||||||
|             this.typeCheckbox = new System.Windows.Forms.CheckBox(); |             this.typeCheckbox = new System.Windows.Forms.CheckBox(); | ||||||
|  |             this.aboutLabel = new System.Windows.Forms.Label(); | ||||||
|             ((System.ComponentModel.ISupportInitialize)(this.albumArtPicBox)).BeginInit(); |             ((System.ComponentModel.ISupportInitialize)(this.albumArtPicBox)).BeginInit(); | ||||||
|             ((System.ComponentModel.ISupportInitialize)(this.logoBox)).BeginInit(); |             ((System.ComponentModel.ISupportInitialize)(this.logoBox)).BeginInit(); | ||||||
|             ((System.ComponentModel.ISupportInitialize)(this.profilePictureBox)).BeginInit(); |             ((System.ComponentModel.ISupportInitialize)(this.profilePictureBox)).BeginInit(); | ||||||
| @ -982,12 +983,29 @@ | |||||||
|             this.typeCheckbox.UseVisualStyleBackColor = true; |             this.typeCheckbox.UseVisualStyleBackColor = true; | ||||||
|             this.typeCheckbox.CheckedChanged += new System.EventHandler(this.typeCheckbox_CheckedChanged); |             this.typeCheckbox.CheckedChanged += new System.EventHandler(this.typeCheckbox_CheckedChanged); | ||||||
|             //  |             //  | ||||||
|  |             // aboutLabel | ||||||
|  |             //  | ||||||
|  |             this.aboutLabel.AutoSize = true; | ||||||
|  |             this.aboutLabel.BackColor = System.Drawing.Color.Transparent; | ||||||
|  |             this.aboutLabel.Font = new System.Drawing.Font("Calibri", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); | ||||||
|  |             this.aboutLabel.ForeColor = System.Drawing.Color.White; | ||||||
|  |             this.aboutLabel.Location = new System.Drawing.Point(866, 8); | ||||||
|  |             this.aboutLabel.Name = "aboutLabel"; | ||||||
|  |             this.aboutLabel.Size = new System.Drawing.Size(15, 23); | ||||||
|  |             this.aboutLabel.TabIndex = 99; | ||||||
|  |             this.aboutLabel.Text = "i"; | ||||||
|  |             this.aboutLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter; | ||||||
|  |             this.aboutLabel.Click += new System.EventHandler(this.aboutLabel_Click); | ||||||
|  |             this.aboutLabel.MouseLeave += new System.EventHandler(this.aboutLabel_MouseLeave); | ||||||
|  |             this.aboutLabel.MouseHover += new System.EventHandler(this.aboutLabel_MouseHover); | ||||||
|  |             //  | ||||||
|             // QobuzDownloaderX |             // QobuzDownloaderX | ||||||
|             //  |             //  | ||||||
|             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); | ||||||
|             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | ||||||
|             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20))))); |             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, 733); | ||||||
|  |             this.Controls.Add(this.aboutLabel); | ||||||
|             this.Controls.Add(this.typeCheckbox); |             this.Controls.Add(this.typeCheckbox); | ||||||
|             this.Controls.Add(this.artSizeSelect); |             this.Controls.Add(this.artSizeSelect); | ||||||
|             this.Controls.Add(this.artSizeLabel); |             this.Controls.Add(this.artSizeLabel); | ||||||
| @ -1151,6 +1169,7 @@ | |||||||
|         private System.Windows.Forms.ComboBox artSizeSelect; |         private System.Windows.Forms.ComboBox artSizeSelect; | ||||||
|         private System.Windows.Forms.Label artSizeLabel; |         private System.Windows.Forms.Label artSizeLabel; | ||||||
|         private System.Windows.Forms.CheckBox typeCheckbox; |         private System.Windows.Forms.CheckBox typeCheckbox; | ||||||
|  |         private System.Windows.Forms.Label aboutLabel; | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										17
									
								
								QobuzDownloaderX/LoginForm-v2.Designer.cs
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										17
									
								
								QobuzDownloaderX/LoginForm-v2.Designer.cs
									
									
									
										generated
									
									
									
								
							| @ -49,6 +49,7 @@ | |||||||
|             this.altLoginTutLabel = new System.Windows.Forms.Label(); |             this.altLoginTutLabel = new System.Windows.Forms.Label(); | ||||||
|             this.userIdTextbox = new System.Windows.Forms.TextBox(); |             this.userIdTextbox = new System.Windows.Forms.TextBox(); | ||||||
|             this.altLoginBG = new System.ComponentModel.BackgroundWorker(); |             this.altLoginBG = new System.ComponentModel.BackgroundWorker(); | ||||||
|  |             this.aboutLabel = new System.Windows.Forms.Label(); | ||||||
|             this.panel1.SuspendLayout(); |             this.panel1.SuspendLayout(); | ||||||
|             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); |             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); | ||||||
|             this.SuspendLayout(); |             this.SuspendLayout(); | ||||||
| @ -56,6 +57,7 @@ | |||||||
|             // panel1 |             // panel1 | ||||||
|             //  |             //  | ||||||
|             this.panel1.BackgroundImage = global::QobuzDownloaderX.Properties.Resources.login_frame; |             this.panel1.BackgroundImage = global::QobuzDownloaderX.Properties.Resources.login_frame; | ||||||
|  |             this.panel1.Controls.Add(this.aboutLabel); | ||||||
|             this.panel1.Controls.Add(this.disableLogin); |             this.panel1.Controls.Add(this.disableLogin); | ||||||
|             this.panel1.Controls.Add(this.verNumLabel2); |             this.panel1.Controls.Add(this.verNumLabel2); | ||||||
|             this.panel1.Controls.Add(this.md5Button); |             this.panel1.Controls.Add(this.md5Button); | ||||||
| @ -286,6 +288,20 @@ | |||||||
|             //  |             //  | ||||||
|             this.altLoginBG.DoWork += new System.ComponentModel.DoWorkEventHandler(this.altLoginBG_DoWork); |             this.altLoginBG.DoWork += new System.ComponentModel.DoWorkEventHandler(this.altLoginBG_DoWork); | ||||||
|             //  |             //  | ||||||
|  |             // aboutLabel | ||||||
|  |             //  | ||||||
|  |             this.aboutLabel.AutoSize = true; | ||||||
|  |             this.aboutLabel.BackColor = System.Drawing.Color.Transparent; | ||||||
|  |             this.aboutLabel.Font = new System.Drawing.Font("Calibri", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); | ||||||
|  |             this.aboutLabel.ForeColor = System.Drawing.Color.Black; | ||||||
|  |             this.aboutLabel.Location = new System.Drawing.Point(241, 0); | ||||||
|  |             this.aboutLabel.Name = "aboutLabel"; | ||||||
|  |             this.aboutLabel.Size = new System.Drawing.Size(15, 23); | ||||||
|  |             this.aboutLabel.TabIndex = 35; | ||||||
|  |             this.aboutLabel.Text = "i"; | ||||||
|  |             this.aboutLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter; | ||||||
|  |             this.aboutLabel.Click += new System.EventHandler(this.aboutLabel_Click); | ||||||
|  |             //  | ||||||
|             // LoginFrm |             // LoginFrm | ||||||
|             //  |             //  | ||||||
|             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); |             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); | ||||||
| @ -339,5 +355,6 @@ | |||||||
|         private System.Windows.Forms.Label altLoginTutLabel; |         private System.Windows.Forms.Label altLoginTutLabel; | ||||||
|         private System.Windows.Forms.TextBox userIdTextbox; |         private System.Windows.Forms.TextBox userIdTextbox; | ||||||
|         private System.ComponentModel.BackgroundWorker altLoginBG; |         private System.ComponentModel.BackgroundWorker altLoginBG; | ||||||
|  |         private System.Windows.Forms.Label aboutLabel; | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -19,6 +19,7 @@ using System.Net.Http; | |||||||
| using System.Net.Http.Headers; | using System.Net.Http.Headers; | ||||||
| using System.Drawing.Imaging; | using System.Drawing.Imaging; | ||||||
| using TagLib.Flac; | using TagLib.Flac; | ||||||
|  | using Newtonsoft.Json.Linq; | ||||||
| using QobuzDownloaderX; | using QobuzDownloaderX; | ||||||
| 
 | 
 | ||||||
| namespace QobuzDownloaderX | namespace QobuzDownloaderX | ||||||
| @ -44,6 +45,7 @@ namespace QobuzDownloaderX | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         QobuzDownloaderX qbdlx = new QobuzDownloaderX(); |         QobuzDownloaderX qbdlx = new QobuzDownloaderX(); | ||||||
|  |         AboutForm about = new AboutForm(); | ||||||
| 
 | 
 | ||||||
|         public string appSecret { get; set; } |         public string appSecret { get; set; } | ||||||
|         public string appID { get; set; } |         public string appID { get; set; } | ||||||
| @ -92,62 +94,8 @@ namespace QobuzDownloaderX | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         private void LoginFrm_Load(object sender, EventArgs e) |         private async void LoginFrm_Load(object sender, EventArgs e) | ||||||
|         { |         { | ||||||
|             try |  | ||||||
|             { |  | ||||||
|                 WebClient versionURLClient = new WebClient(); |  | ||||||
|                 // Run through TLS to allow secure connection. |  | ||||||
|                 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; |  | ||||||
|                 // Set user-agent to Firefox. |  | ||||||
|                 versionURLClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"); |  | ||||||
|                 string versionHTML = versionURLClient.DownloadString("https://api.github.com/repos/ImAiiR/QobuzDownloaderX/releases/latest"); |  | ||||||
| 
 |  | ||||||
|                 // Grab latest version number |  | ||||||
|                 var versionLog = Regex.Match(versionHTML, "\"tag_name\": \"(?<latestVersion>.*?)\",").Groups; |  | ||||||
|                 var version = versionLog[1].Value; |  | ||||||
| 
 |  | ||||||
|                 // Grab changelog |  | ||||||
|                 var changesLog = Regex.Match(versionHTML, "\"body\": \"(?<changeLog>.*?)\"").Groups; |  | ||||||
|                 var changes = changesLog[1].Value; |  | ||||||
| 
 |  | ||||||
|                 string currentVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); |  | ||||||
|                 string newVersion = version; |  | ||||||
| 
 |  | ||||||
|                 if (currentVersion.Contains(newVersion)) |  | ||||||
|                 { |  | ||||||
|                     // Do nothing. All is good. |  | ||||||
|                 } |  | ||||||
|                 else |  | ||||||
|                 { |  | ||||||
|                     DialogResult dialogResult = MessageBox.Show("New version of QBDLX is available!\r\n\r\nInstalled version - " + currentVersion + "\r\nLatest version - "+ newVersion + "\r\n\r\nChangelog Below\r\n==============\r\n" + changes.Replace("\\r\\n", "\r\n") + "\r\n==============\r\n\r\nWould you like to update?", "QBDLX | Update Available", MessageBoxButtons.YesNo); |  | ||||||
|                     if (dialogResult == DialogResult.Yes) |  | ||||||
|                     { |  | ||||||
|                         // If "Yes" is clicked, open GitHub page and close QBDLX. |  | ||||||
|                         Process.Start("https://github.com/ImAiiR/QobuzDownloaderX/releases/latest"); |  | ||||||
|                         Application.Exit(); |  | ||||||
|                     } |  | ||||||
|                     else if (dialogResult == DialogResult.No) |  | ||||||
|                     { |  | ||||||
|                         // Ignore the update until next open. |  | ||||||
|                     } |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|             catch |  | ||||||
|             { |  | ||||||
|                 DialogResult dialogResult = MessageBox.Show("Connection to GitHub to check for an update has failed.\r\nWould you like to check for an update manually?\r\n\r\nYour current version is " + Assembly.GetExecutingAssembly().GetName().Version.ToString(), "QBDLX | GitHub Connection Failed", MessageBoxButtons.YesNo); |  | ||||||
|                 if (dialogResult == DialogResult.Yes) |  | ||||||
|                 { |  | ||||||
|                     // If "Yes" is clicked, open GitHub page and close QBDLX. |  | ||||||
|                     Process.Start("https://github.com/ImAiiR/QobuzDownloaderX/releases/latest"); |  | ||||||
|                     Application.Exit(); |  | ||||||
|                 } |  | ||||||
|                 else if (dialogResult == DialogResult.No) |  | ||||||
|                 { |  | ||||||
|                     // Ignore the update until next open. |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
| 
 |  | ||||||
|             // Get and display version number. |             // Get and display version number. | ||||||
|             verNumLabel2.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString(); |             verNumLabel2.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString(); | ||||||
| 
 | 
 | ||||||
| @ -255,6 +203,65 @@ namespace QobuzDownloaderX | |||||||
|                 userAuthTokenTextbox.UseSystemPasswordChar = true; |                 userAuthTokenTextbox.UseSystemPasswordChar = true; | ||||||
|                 userAuthTokenTextbox.Text = "user_auth_token"; |                 userAuthTokenTextbox.Text = "user_auth_token"; | ||||||
|             } |             } | ||||||
|  | 
 | ||||||
|  |             try | ||||||
|  |             { | ||||||
|  |                 // Create HttpClient to grab version number from Github | ||||||
|  |                 var versionURLClient = new HttpClient(); | ||||||
|  |                 // Run through TLS to allow secure connection. | ||||||
|  |                 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; | ||||||
|  |                 // Set user-agent to Firefox. | ||||||
|  |                 versionURLClient.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"); | ||||||
|  | 
 | ||||||
|  |                 // Grab response from Github to get Track IDs from Album response. | ||||||
|  |                 var versionURL = "https://api.github.com/repos/ImAiiR/QobuzDownloaderX/releases/latest"; | ||||||
|  |                 var versionURLResponse = await versionURLClient.GetAsync(versionURL); | ||||||
|  |                 string versionURLResponseString = versionURLResponse.Content.ReadAsStringAsync().Result; | ||||||
|  | 
 | ||||||
|  |                 // Grab metadata from API JSON response | ||||||
|  |                 JObject joVersionResponse = JObject.Parse(versionURLResponseString); | ||||||
|  | 
 | ||||||
|  |                 // Grab latest version number | ||||||
|  |                 string version = (string)joVersionResponse["tag_name"]; | ||||||
|  |                 // Grab changelog | ||||||
|  |                 string changes = (string)joVersionResponse["body"]; | ||||||
|  | 
 | ||||||
|  |                 string currentVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); | ||||||
|  |                 string newVersion = version; | ||||||
|  | 
 | ||||||
|  |                 if (currentVersion.Contains(newVersion)) | ||||||
|  |                 { | ||||||
|  |                     // Do nothing. All is good. | ||||||
|  |                 } | ||||||
|  |                 else | ||||||
|  |                 { | ||||||
|  |                     DialogResult dialogResult = MessageBox.Show("New version of QBDLX is available!\r\n\r\nInstalled version - " + currentVersion + "\r\nLatest version - " + newVersion + "\r\n\r\nChangelog Below\r\n==============\r\n" + changes.Replace("\\r\\n", "\r\n") + "\r\n==============\r\n\r\nWould you like to update?", "QBDLX | Update Available", MessageBoxButtons.YesNo); | ||||||
|  |                     if (dialogResult == DialogResult.Yes) | ||||||
|  |                     { | ||||||
|  |                         // If "Yes" is clicked, open GitHub page and close QBDLX. | ||||||
|  |                         Process.Start("https://github.com/ImAiiR/QobuzDownloaderX/releases/latest"); | ||||||
|  |                         Application.Exit(); | ||||||
|  |                     } | ||||||
|  |                     else if (dialogResult == DialogResult.No) | ||||||
|  |                     { | ||||||
|  |                         // Ignore the update until next open. | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |             catch | ||||||
|  |             { | ||||||
|  |                 DialogResult dialogResult = MessageBox.Show("Connection to GitHub to check for an update has failed.\r\nWould you like to check for an update manually?\r\n\r\nYour current version is " + Assembly.GetExecutingAssembly().GetName().Version.ToString(), "QBDLX | GitHub Connection Failed", MessageBoxButtons.YesNo); | ||||||
|  |                 if (dialogResult == DialogResult.Yes) | ||||||
|  |                 { | ||||||
|  |                     // If "Yes" is clicked, open GitHub page and close QBDLX. | ||||||
|  |                     Process.Start("https://github.com/ImAiiR/QobuzDownloaderX/releases/latest"); | ||||||
|  |                     Application.Exit(); | ||||||
|  |                 } | ||||||
|  |                 else if (dialogResult == DialogResult.No) | ||||||
|  |                 { | ||||||
|  |                     // Ignore the update until next open. | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         private void loginButton_Click(object sender, EventArgs e) |         private void loginButton_Click(object sender, EventArgs e) | ||||||
| @ -262,10 +269,13 @@ namespace QobuzDownloaderX | |||||||
|             // Hide alt login label until job is finished or failed |             // Hide alt login label until job is finished or failed | ||||||
|             altLoginLabel.Visible = false; |             altLoginLabel.Visible = false; | ||||||
| 
 | 
 | ||||||
|             // If logging in normally (email & password) |             switch (altLoginValue) | ||||||
|             if (altLoginValue == "0") |  | ||||||
|             { |             { | ||||||
|  |                 // If logging in normally (email & password) | ||||||
|  |                 case "0": | ||||||
|                     #region Normal Login |                     #region Normal Login | ||||||
|  | 
 | ||||||
|  |                     #region Check if textboxes are valid | ||||||
|                     if (emailTextbox.Text == "Email" | emailTextbox.Text == null | emailTextbox.Text == "") |                     if (emailTextbox.Text == "Email" | emailTextbox.Text == null | emailTextbox.Text == "") | ||||||
|                     { |                     { | ||||||
|                         // If there's no email typed in. |                         // If there's no email typed in. | ||||||
| @ -279,6 +289,7 @@ namespace QobuzDownloaderX | |||||||
|                         loginText.Invoke(new Action(() => loginText.Text = "No password typed, please input password first.")); |                         loginText.Invoke(new Action(() => loginText.Text = "No password typed, please input password first.")); | ||||||
|                         return; |                         return; | ||||||
|                     } |                     } | ||||||
|  |                     #endregion | ||||||
| 
 | 
 | ||||||
|                     string plainTextPW = passwordTextbox.Text; |                     string plainTextPW = passwordTextbox.Text; | ||||||
| 
 | 
 | ||||||
| @ -316,11 +327,11 @@ namespace QobuzDownloaderX | |||||||
|                     loginButton.Enabled = false; |                     loginButton.Enabled = false; | ||||||
|                     getSecretBG.RunWorkerAsync(); |                     getSecretBG.RunWorkerAsync(); | ||||||
|                     #endregion |                     #endregion | ||||||
|             } |                     break; | ||||||
|             // If logging in the alternate way (user_id & user_auth_token) |                 default: | ||||||
|             else |  | ||||||
|             { |  | ||||||
|                     #region Alt Login |                     #region Alt Login | ||||||
|  | 
 | ||||||
|  |                     #region Check if textboxes are valid | ||||||
|                     if (userIdTextbox.Text == "user_id" | userIdTextbox.Text == null | userIdTextbox.Text == "") |                     if (userIdTextbox.Text == "user_id" | userIdTextbox.Text == null | userIdTextbox.Text == "") | ||||||
|                     { |                     { | ||||||
|                         // If there's no email typed in. |                         // If there's no email typed in. | ||||||
| @ -334,6 +345,7 @@ namespace QobuzDownloaderX | |||||||
|                         loginText.Invoke(new Action(() => loginText.Text = "No user_auth_token typed, please input user_auth_token first.")); |                         loginText.Invoke(new Action(() => loginText.Text = "No user_auth_token typed, please input user_auth_token first.")); | ||||||
|                         return; |                         return; | ||||||
|                     } |                     } | ||||||
|  |                     #endregion | ||||||
| 
 | 
 | ||||||
|                     // Set user_id & user_auth_token to login. |                     // Set user_id & user_auth_token to login. | ||||||
|                     userID = userIdTextbox.Text; |                     userID = userIdTextbox.Text; | ||||||
| @ -349,6 +361,7 @@ namespace QobuzDownloaderX | |||||||
|                     loginButton.Enabled = false; |                     loginButton.Enabled = false; | ||||||
|                     getSecretBG.RunWorkerAsync(); |                     getSecretBG.RunWorkerAsync(); | ||||||
|                     #endregion |                     #endregion | ||||||
|  |                     break; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| @ -430,48 +443,67 @@ namespace QobuzDownloaderX | |||||||
|             getSecretBG.CancelAsync(); |             getSecretBG.CancelAsync(); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         private void loginBG_DoWork(object sender, DoWorkEventArgs e) |         private async void loginBG_DoWork(object sender, DoWorkEventArgs e) | ||||||
|         { |         { | ||||||
|             loginBG.WorkerSupportsCancellation = true; |             loginBG.WorkerSupportsCancellation = true; | ||||||
| 
 | 
 | ||||||
|             // Create WebRequest to login using login information from input textboxes. |             // Create HttpClient to grab Track ID | ||||||
|             WebRequest wr = WebRequest.Create("https://www.qobuz.com/api.json/0.2/user/login?email=" + emailTextbox.Text + "&password=" + passwordTextbox.Text + "&app_id=" + appID); |             var loginClient = new HttpClient(); | ||||||
|  |             // Run through TLS to allow secure connection. | ||||||
|  |             ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; | ||||||
|  |             // Set user-agent to Firefox. | ||||||
|  |             loginClient.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"); | ||||||
|  | 
 | ||||||
|  |             // Grab response from Rhapsody to get Track IDs from Album response. | ||||||
|  |             var loginUrl = "https://www.qobuz.com/api.json/0.2/user/login?email=" + emailTextbox.Text + "&password=" + passwordTextbox.Text + "&app_id=" + appID; | ||||||
|  |             var loginResponse = await loginClient.GetAsync(loginUrl); | ||||||
|  |             string loginResponseString = loginResponse.Content.ReadAsStringAsync().Result; | ||||||
|  | 
 | ||||||
|  |             // Grab metadata from API JSON response | ||||||
|  |             JObject joLoginResponse = JObject.Parse(loginResponseString); | ||||||
| 
 | 
 | ||||||
|             try |             try | ||||||
|             { |             { | ||||||
|                 // Grab info to be displayed and used. |  | ||||||
|                 WebResponse ws = wr.GetResponse(); |  | ||||||
|                 StreamReader sr = new StreamReader(ws.GetResponseStream()); |  | ||||||
| 
 |  | ||||||
|                 string loginRequest = sr.ReadToEnd(); |  | ||||||
|                 string text = loginRequest; |  | ||||||
| 
 |  | ||||||
|                 // Grab user_id |                 // Grab user_id | ||||||
|                 var userIDLog = Regex.Match(loginRequest, "{\"user\":{\"id\":(?<userID>.*?),\"publicId").Groups; |                 string userID = (string)joLoginResponse["user"]["id"]; | ||||||
|                 var userID = userIDLog[1].Value; |  | ||||||
|                 qbdlx.userID = userID; |                 qbdlx.userID = userID; | ||||||
| 
 | 
 | ||||||
|                 // Grab display name |                 // Grab display name | ||||||
|                 var displayNameLog = Regex.Match(loginRequest, "\"display_name\":\"(?<displayName>.*?)\",\\\"").Groups; |                 string displayName = (string)joLoginResponse["user"]["display_name"]; | ||||||
|                 var displayName = displayNameLog[1].Value; |  | ||||||
|                 qbdlx.displayName = displayName; |                 qbdlx.displayName = displayName; | ||||||
| 
 | 
 | ||||||
|                 // Grab account type |                 // Grab account type | ||||||
|                 var accountTypeLog = Regex.Match(loginRequest, "short_label\":\"(?<accountType>\\w+)").Groups; |                 try | ||||||
|                 var accountType = accountTypeLog[1].Value; |                 { | ||||||
|  |                     string accountType = (string)joLoginResponse["user"]["credential"]["parameters"]["short_label"]; | ||||||
|  | 
 | ||||||
|  |                     // Check if accountType returns null or not | ||||||
|  |                     switch (accountType) | ||||||
|  |                     { | ||||||
|  |                         case null: | ||||||
|  |                             qbdlx.accountType = null; | ||||||
|  |                             break; | ||||||
|  |                         default: | ||||||
|                             qbdlx.accountType = accountType; |                             qbdlx.accountType = accountType; | ||||||
|  |                             break; | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |                 catch | ||||||
|  |                 { | ||||||
|  |                     // Free account, still able to login but won't be able to download anything. | ||||||
|  |                     qbdlx.accountType = null; | ||||||
|  |                 } | ||||||
| 
 | 
 | ||||||
|                 // Grab authentication token |                 // Grab authentication token | ||||||
|                 var userAuth = Regex.Match(loginRequest, "\"user_auth_token\":\"(?<userAuth>.*?)\\\"}").Groups; |                 string userAuthToken = (string)joLoginResponse["user_auth_token"]; | ||||||
|                 var userAuthToken = userAuth[1].Value; |                 qbdlx.userAuth = userAuthToken; | ||||||
| 
 | 
 | ||||||
|                 // Grab profile image |                 // Grab profile image | ||||||
|                 var profilePic = Regex.Match(loginRequest, "avatar\\\":\\\"(?<profilePic>.*?)\",").Groups; |                 string profilePic = (string)joLoginResponse["user"]["avatar"]; | ||||||
|                 var profilePicURL = profilePic[1].Value.Replace(@"\", null).Replace("s=50", "s=20"); |                 string profilePicURL = profilePic.Replace(@"\", null).Replace("s=50", "s=20"); | ||||||
|                 qbdlx.profilePic = profilePicURL; |                 qbdlx.profilePic = profilePicURL; | ||||||
| 
 | 
 | ||||||
|                 // Set user_auth_token |                 // Set user_auth_token | ||||||
|                 qbdlx.userAuth = userAuthToken; |  | ||||||
|                 loginText.Invoke(new Action(() => loginText.Text = "Login Successful! Launching QBDLX...")); |                 loginText.Invoke(new Action(() => loginText.Text = "Login Successful! Launching QBDLX...")); | ||||||
|             } |             } | ||||||
|             catch (Exception ex) |             catch (Exception ex) | ||||||
| @ -480,33 +512,36 @@ namespace QobuzDownloaderX | |||||||
|                 string error = ex.ToString(); |                 string error = ex.ToString(); | ||||||
|                 loginText.Invoke(new Action(() => loginText.Text = "Login Failed. Error Log saved")); |                 loginText.Invoke(new Action(() => loginText.Text = "Login Failed. Error Log saved")); | ||||||
|                 System.IO.File.WriteAllText(errorLog, error); |                 System.IO.File.WriteAllText(errorLog, error); | ||||||
|                 wr.Abort(); |  | ||||||
|                 loginButton.Invoke(new Action(() => loginButton.Enabled = true)); |                 loginButton.Invoke(new Action(() => loginButton.Enabled = true)); | ||||||
|                 altLoginLabel.Invoke(new Action(() => altLoginLabel.Visible = true)); |                 altLoginLabel.Invoke(new Action(() => altLoginLabel.Visible = true)); | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|              |              | ||||||
|             wr.Abort(); |  | ||||||
|             finishLogin(sender, e); |             finishLogin(sender, e); | ||||||
|             loginBG.CancelAsync(); |             loginBG.CancelAsync(); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         private void altLoginBG_DoWork(object sender, DoWorkEventArgs e) |         private async void altLoginBG_DoWork(object sender, DoWorkEventArgs e) | ||||||
|         { |         { | ||||||
|             altLoginBG.WorkerSupportsCancellation = true; |             altLoginBG.WorkerSupportsCancellation = true; | ||||||
| 
 | 
 | ||||||
|             // Create WebRequest to login using login information from input textboxes. |             // Create HttpClient to grab Track ID | ||||||
|             WebRequest wr = WebRequest.Create("http://www.qobuz.com/api.json/0.2/user/get?user_id=" + userID + "&user_auth_token=" + userAuthToken + "&app_id=" + appID); |             var altLoginClient = new HttpClient(); | ||||||
|  |             // Run through TLS to allow secure connection. | ||||||
|  |             ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; | ||||||
|  |             // Set user-agent to Firefox. | ||||||
|  |             altLoginClient.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"); | ||||||
|  | 
 | ||||||
|  |             // Grab response from Rhapsody to get Track IDs from Album response. | ||||||
|  |             var altLoginUrl = "http://www.qobuz.com/api.json/0.2/user/get?user_id=" + userID + "&user_auth_token=" + userAuthToken + "&app_id=" + appID; | ||||||
|  |             var altLoginResponse = await altLoginClient.GetAsync(altLoginUrl); | ||||||
|  |             string altLoginResponseString = altLoginResponse.Content.ReadAsStringAsync().Result; | ||||||
|  | 
 | ||||||
|  |             // Grab metadata from API JSON response | ||||||
|  |             JObject joAltLoginResponse = JObject.Parse(altLoginResponseString); | ||||||
| 
 | 
 | ||||||
|             try |             try | ||||||
|             { |             { | ||||||
|                 // Grab info to be displayed and used. |  | ||||||
|                 WebResponse ws = wr.GetResponse(); |  | ||||||
|                 StreamReader sr = new StreamReader(ws.GetResponseStream()); |  | ||||||
| 
 |  | ||||||
|                 string loginRequest = sr.ReadToEnd(); |  | ||||||
|                 string text = loginRequest; |  | ||||||
| 
 |  | ||||||
|                 // Use user_id that was used by the user |                 // Use user_id that was used by the user | ||||||
|                 qbdlx.userID = userID; |                 qbdlx.userID = userID; | ||||||
| 
 | 
 | ||||||
| @ -514,18 +549,34 @@ namespace QobuzDownloaderX | |||||||
|                 qbdlx.userAuth = userAuthToken; |                 qbdlx.userAuth = userAuthToken; | ||||||
| 
 | 
 | ||||||
|                 // Grab display name |                 // Grab display name | ||||||
|                 var displayNameLog = Regex.Match(loginRequest, "\"display_name\":\"(?<displayName>.*?)\",\\\"").Groups; |                 string displayName = (string)joAltLoginResponse["display_name"]; | ||||||
|                 var displayName = displayNameLog[1].Value; |  | ||||||
|                 qbdlx.displayName = displayName; |                 qbdlx.displayName = displayName; | ||||||
| 
 | 
 | ||||||
|                 // Grab account type |                 // Grab account type | ||||||
|                 var accountTypeLog = Regex.Match(loginRequest, "short_label\":\"(?<accountType>\\w+)").Groups; |                 try | ||||||
|                 var accountType = accountTypeLog[1].Value; |                 { | ||||||
|  |                     string accountType = (string)joAltLoginResponse["subscription"]["offer"]; | ||||||
|  | 
 | ||||||
|  |                     // Check if accountType returns null or not | ||||||
|  |                     switch (accountType) | ||||||
|  |                     { | ||||||
|  |                         case null: | ||||||
|  |                             qbdlx.accountType = null; | ||||||
|  |                             break; | ||||||
|  |                         default: | ||||||
|                             qbdlx.accountType = accountType; |                             qbdlx.accountType = accountType; | ||||||
|  |                             break; | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |                 catch | ||||||
|  |                 { | ||||||
|  |                     // Free account, still able to login but won't be able to download anything. | ||||||
|  |                     qbdlx.accountType = null; | ||||||
|  |                 } | ||||||
| 
 | 
 | ||||||
|                 // Grab profile image |                 // Grab profile image | ||||||
|                 var profilePic = Regex.Match(loginRequest, "avatar\\\":\\\"(?<profilePic>.*?)\\\"}").Groups; |                 string profilePic = (string)joAltLoginResponse["avatar"]; | ||||||
|                 var profilePicURL = profilePic[1].Value.Replace(@"\", null).Replace("s=50", "s=20"); |                 var profilePicURL = profilePic.Replace(@"\", null).Replace("s=50", "s=20"); | ||||||
|                 qbdlx.profilePic = profilePicURL; |                 qbdlx.profilePic = profilePicURL; | ||||||
|                  |                  | ||||||
|                 loginText.Invoke(new Action(() => loginText.Text = "Login Successful! Launching QBDLX...")); |                 loginText.Invoke(new Action(() => loginText.Text = "Login Successful! Launching QBDLX...")); | ||||||
| @ -536,13 +587,11 @@ namespace QobuzDownloaderX | |||||||
|                 string error = ex.ToString(); |                 string error = ex.ToString(); | ||||||
|                 loginText.Invoke(new Action(() => loginText.Text = "Login Failed. Error Log saved")); |                 loginText.Invoke(new Action(() => loginText.Text = "Login Failed. Error Log saved")); | ||||||
|                 System.IO.File.WriteAllText(errorLog, error); |                 System.IO.File.WriteAllText(errorLog, error); | ||||||
|                 wr.Abort(); |  | ||||||
|                 loginButton.Invoke(new Action(() => loginButton.Enabled = true)); |                 loginButton.Invoke(new Action(() => loginButton.Enabled = true)); | ||||||
|                 altLoginLabel.Invoke(new Action(() => altLoginLabel.Visible = true)); |                 altLoginLabel.Invoke(new Action(() => altLoginLabel.Visible = true)); | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|              |              | ||||||
|             wr.Abort(); |  | ||||||
|             finishLogin(sender, e); |             finishLogin(sender, e); | ||||||
|             altLoginBG.CancelAsync(); |             altLoginBG.CancelAsync(); | ||||||
|         } |         } | ||||||
| @ -805,5 +854,10 @@ namespace QobuzDownloaderX | |||||||
|         { |         { | ||||||
|             Process.Start("https://github.com/ImAiiR/QobuzDownloaderX/wiki/Logging-In-(The-Alternate-Way)"); |             Process.Start("https://github.com/ImAiiR/QobuzDownloaderX/wiki/Logging-In-(The-Alternate-Way)"); | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|  |         private void aboutLabel_Click(object sender, EventArgs e) | ||||||
|  |         { | ||||||
|  |             about.Show(); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -32,5 +32,5 @@ using System.Runtime.InteropServices; | |||||||
| // You can specify all the values or you can default the Build and Revision Numbers  | // You can specify all the values or you can default the Build and Revision Numbers  | ||||||
| // by using the '*' as shown below: | // by using the '*' as shown below: | ||||||
| // [assembly: AssemblyVersion("1.0.*")] | // [assembly: AssemblyVersion("1.0.*")] | ||||||
| [assembly: AssemblyVersion("0.9.9.16")] | [assembly: AssemblyVersion("0.9.9.17")] | ||||||
| [assembly: AssemblyFileVersion("0.9.9.16")] | [assembly: AssemblyFileVersion("0.9.9.17")] | ||||||
|  | |||||||
| @ -52,6 +52,10 @@ | |||||||
|     <ApplicationIcon>Resources\qbdlx_icon.ico</ApplicationIcon> |     <ApplicationIcon>Resources\qbdlx_icon.ico</ApplicationIcon> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|  |     <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | ||||||
|  |       <HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> | ||||||
|  |       <Private>True</Private> | ||||||
|  |     </Reference> | ||||||
|     <Reference Include="policy.2.0.taglib-sharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=db62eba44689b5b0, processorArchitecture=MSIL"> |     <Reference Include="policy.2.0.taglib-sharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=db62eba44689b5b0, processorArchitecture=MSIL"> | ||||||
|       <HintPath>..\packages\taglib.2.1.0.0\lib\policy.2.0.taglib-sharp.dll</HintPath> |       <HintPath>..\packages\taglib.2.1.0.0\lib\policy.2.0.taglib-sharp.dll</HintPath> | ||||||
|       <Private>True</Private> |       <Private>True</Private> | ||||||
| @ -79,6 +83,12 @@ | |||||||
|     <Compile Include="Form1.Designer.cs"> |     <Compile Include="Form1.Designer.cs"> | ||||||
|       <DependentUpon>Form1.cs</DependentUpon> |       <DependentUpon>Form1.cs</DependentUpon> | ||||||
|     </Compile> |     </Compile> | ||||||
|  |     <Compile Include="AboutForm.cs"> | ||||||
|  |       <SubType>Form</SubType> | ||||||
|  |     </Compile> | ||||||
|  |     <Compile Include="AboutForm.Designer.cs"> | ||||||
|  |       <DependentUpon>AboutForm.cs</DependentUpon> | ||||||
|  |     </Compile> | ||||||
|     <Compile Include="LoginForm-v2.cs"> |     <Compile Include="LoginForm-v2.cs"> | ||||||
|       <SubType>Form</SubType> |       <SubType>Form</SubType> | ||||||
|     </Compile> |     </Compile> | ||||||
| @ -103,6 +113,9 @@ | |||||||
|     <EmbeddedResource Include="Form1.resx"> |     <EmbeddedResource Include="Form1.resx"> | ||||||
|       <DependentUpon>Form1.cs</DependentUpon> |       <DependentUpon>Form1.cs</DependentUpon> | ||||||
|     </EmbeddedResource> |     </EmbeddedResource> | ||||||
|  |     <EmbeddedResource Include="AboutForm.resx"> | ||||||
|  |       <DependentUpon>AboutForm.cs</DependentUpon> | ||||||
|  |     </EmbeddedResource> | ||||||
|     <EmbeddedResource Include="LoginForm-v2.resx"> |     <EmbeddedResource Include="LoginForm-v2.resx"> | ||||||
|       <DependentUpon>LoginForm-v2.cs</DependentUpon> |       <DependentUpon>LoginForm-v2.cs</DependentUpon> | ||||||
|     </EmbeddedResource> |     </EmbeddedResource> | ||||||
|  | |||||||
| @ -1,4 +1,5 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <packages> | <packages> | ||||||
|  |   <package id="Newtonsoft.Json" version="12.0.3" targetFramework="net46" /> | ||||||
|   <package id="taglib" version="2.1.0.0" targetFramework="net46" /> |   <package id="taglib" version="2.1.0.0" targetFramework="net46" /> | ||||||
| </packages> | </packages> | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 AiiR
						AiiR