From 4f4564a21e174dc010ddb5222c5bcd4a461bee86 Mon Sep 17 00:00:00 2001 From: Initial-heart-1 Date: Mon, 28 Nov 2022 17:30:33 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=BD=91=E6=98=93=E4=BA=91=E5=AF=B9API?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E7=9A=84=E9=99=90=E9=80=9F=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E5=8D=8A=E5=A4=B1=E6=95=88=20=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E5=80=9F=E7=94=A8=E6=9C=8B=E5=8F=8B=E7=94=B5=E8=84=91=E7=A0=81?= =?UTF-8?q?=E7=9A=84=EF=BC=8C=E6=95=85=E6=8F=90=E4=BA=A4=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LrcHelper/App.config | 2 +- LrcHelper/LrcDownloader.Designer.cs | 238 +++++++++++---------- LrcHelper/LrcDownloader.cs | 19 +- LrcHelper/LrcHelper.csproj | 2 +- LrcHelper/NeteaseMusic.cs | 12 +- LrcHelper/Properties/Resources.Designer.cs | 6 +- LrcHelper/Properties/Settings.Designer.cs | 2 +- 7 files changed, 163 insertions(+), 118 deletions(-) diff --git a/LrcHelper/App.config b/LrcHelper/App.config index 877624e..5ffd8f8 100644 --- a/LrcHelper/App.config +++ b/LrcHelper/App.config @@ -1,6 +1,6 @@ - + diff --git a/LrcHelper/LrcDownloader.Designer.cs b/LrcHelper/LrcDownloader.Designer.cs index 412f9ab..70b9b5e 100644 --- a/LrcHelper/LrcDownloader.Designer.cs +++ b/LrcHelper/LrcDownloader.Designer.cs @@ -47,6 +47,9 @@ private void InitializeComponent() this.AutoSetcheckBox = new System.Windows.Forms.CheckBox(); this.AlbumradioButton = new System.Windows.Forms.RadioButton(); this.AdvancedSettingsgroupBox = new System.Windows.Forms.GroupBox(); + this.LowDelaycheckBox = new System.Windows.Forms.CheckBox(); + this.CookietextBox = new System.Windows.Forms.TextBox(); + this.CookieLabel = new System.Windows.Forms.Label(); this.EncodingcomboBox = new System.Windows.Forms.ComboBox(); this.ReviseRawcheckBox = new System.Windows.Forms.CheckBox(); this.Savelabel = new System.Windows.Forms.Label(); @@ -59,8 +62,6 @@ private void InitializeComponent() this.AdvancedSettingscheckBox = new System.Windows.Forms.CheckBox(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.needhelplabel = new System.Windows.Forms.Label(); - this.CookieLabel = new System.Windows.Forms.Label(); - this.CookietextBox = new System.Windows.Forms.TextBox(); this.StatusgroupBox.SuspendLayout(); this.AdvancedSettingsgroupBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.DelayMsecnumericUpDown)).BeginInit(); @@ -69,39 +70,39 @@ private void InitializeComponent() // // IDtextBox // - this.IDtextBox.Location = new System.Drawing.Point(97, 15); - this.IDtextBox.Margin = new System.Windows.Forms.Padding(7); + this.IDtextBox.Location = new System.Drawing.Point(58, 9); + this.IDtextBox.Margin = new System.Windows.Forms.Padding(4); this.IDtextBox.Name = "IDtextBox"; - this.IDtextBox.Size = new System.Drawing.Size(244, 42); + this.IDtextBox.Size = new System.Drawing.Size(148, 28); this.IDtextBox.TabIndex = 0; // // IDlabel // this.IDlabel.AutoSize = true; - this.IDlabel.Location = new System.Drawing.Point(30, 23); - this.IDlabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.IDlabel.Location = new System.Drawing.Point(18, 14); + this.IDlabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.IDlabel.Name = "IDlabel"; - this.IDlabel.Size = new System.Drawing.Size(58, 30); + this.IDlabel.Size = new System.Drawing.Size(35, 18); this.IDlabel.TabIndex = 1; this.IDlabel.Text = "ID:"; // // Functionlabel // this.Functionlabel.AutoSize = true; - this.Functionlabel.Location = new System.Drawing.Point(25, 97); - this.Functionlabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.Functionlabel.Location = new System.Drawing.Point(15, 58); + this.Functionlabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.Functionlabel.Name = "Functionlabel"; - this.Functionlabel.Size = new System.Drawing.Size(118, 30); + this.Functionlabel.Size = new System.Drawing.Size(71, 18); this.Functionlabel.TabIndex = 2; this.Functionlabel.Text = "这是..."; // // MusicradioButton // this.MusicradioButton.AutoSize = true; - this.MusicradioButton.Location = new System.Drawing.Point(207, 93); - this.MusicradioButton.Margin = new System.Windows.Forms.Padding(7); + this.MusicradioButton.Location = new System.Drawing.Point(124, 56); + this.MusicradioButton.Margin = new System.Windows.Forms.Padding(4); this.MusicradioButton.Name = "MusicradioButton"; - this.MusicradioButton.Size = new System.Drawing.Size(94, 34); + this.MusicradioButton.Size = new System.Drawing.Size(69, 22); this.MusicradioButton.TabIndex = 3; this.MusicradioButton.TabStop = true; this.MusicradioButton.Text = "单曲"; @@ -110,10 +111,10 @@ private void InitializeComponent() // PlaylistradioButton // this.PlaylistradioButton.AutoSize = true; - this.PlaylistradioButton.Location = new System.Drawing.Point(335, 93); - this.PlaylistradioButton.Margin = new System.Windows.Forms.Padding(7); + this.PlaylistradioButton.Location = new System.Drawing.Point(201, 56); + this.PlaylistradioButton.Margin = new System.Windows.Forms.Padding(4); this.PlaylistradioButton.Name = "PlaylistradioButton"; - this.PlaylistradioButton.Size = new System.Drawing.Size(94, 34); + this.PlaylistradioButton.Size = new System.Drawing.Size(69, 22); this.PlaylistradioButton.TabIndex = 4; this.PlaylistradioButton.TabStop = true; this.PlaylistradioButton.Text = "歌单"; @@ -121,10 +122,10 @@ private void InitializeComponent() // // GETbutton // - this.GETbutton.Location = new System.Drawing.Point(363, 10); - this.GETbutton.Margin = new System.Windows.Forms.Padding(7); + this.GETbutton.Location = new System.Drawing.Point(218, 6); + this.GETbutton.Margin = new System.Windows.Forms.Padding(4); this.GETbutton.Name = "GETbutton"; - this.GETbutton.Size = new System.Drawing.Size(187, 57); + this.GETbutton.Size = new System.Drawing.Size(112, 34); this.GETbutton.TabIndex = 5; this.GETbutton.Text = "下载"; this.GETbutton.UseVisualStyleBackColor = true; @@ -133,20 +134,20 @@ private void InitializeComponent() // Copyrightlabel // this.Copyrightlabel.AutoSize = true; - this.Copyrightlabel.Location = new System.Drawing.Point(562, 418); - this.Copyrightlabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.Copyrightlabel.Location = new System.Drawing.Point(337, 294); + this.Copyrightlabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.Copyrightlabel.Name = "Copyrightlabel"; - this.Copyrightlabel.Size = new System.Drawing.Size(418, 60); + this.Copyrightlabel.Size = new System.Drawing.Size(251, 36); this.Copyrightlabel.TabIndex = 6; this.Copyrightlabel.Text = "Email:hi@luu.moe\r\ngithub.com/ludoux/lrchelper"; // // Cancelbutton // this.Cancelbutton.Enabled = false; - this.Cancelbutton.Location = new System.Drawing.Point(565, 10); - this.Cancelbutton.Margin = new System.Windows.Forms.Padding(7); + this.Cancelbutton.Location = new System.Drawing.Point(339, 6); + this.Cancelbutton.Margin = new System.Windows.Forms.Padding(4); this.Cancelbutton.Name = "Cancelbutton"; - this.Cancelbutton.Size = new System.Drawing.Size(187, 57); + this.Cancelbutton.Size = new System.Drawing.Size(112, 34); this.Cancelbutton.TabIndex = 7; this.Cancelbutton.Text = "取消"; this.Cancelbutton.UseVisualStyleBackColor = true; @@ -159,11 +160,11 @@ private void InitializeComponent() this.StatusgroupBox.Controls.Add(this.StatusPDFinishedlabel); this.StatusgroupBox.Controls.Add(this.StatusPDTotallabel); this.StatusgroupBox.Controls.Add(this.StatusInfolabel); - this.StatusgroupBox.Location = new System.Drawing.Point(547, 147); - this.StatusgroupBox.Margin = new System.Windows.Forms.Padding(7); + this.StatusgroupBox.Location = new System.Drawing.Point(328, 88); + this.StatusgroupBox.Margin = new System.Windows.Forms.Padding(4); this.StatusgroupBox.Name = "StatusgroupBox"; - this.StatusgroupBox.Padding = new System.Windows.Forms.Padding(7); - this.StatusgroupBox.Size = new System.Drawing.Size(500, 250); + this.StatusgroupBox.Padding = new System.Windows.Forms.Padding(4); + this.StatusgroupBox.Size = new System.Drawing.Size(300, 150); this.StatusgroupBox.TabIndex = 8; this.StatusgroupBox.TabStop = false; this.StatusgroupBox.Text = "状态"; @@ -171,49 +172,49 @@ private void InitializeComponent() // StatusPDTotalCountlabel // this.StatusPDTotalCountlabel.AutoSize = true; - this.StatusPDTotalCountlabel.Location = new System.Drawing.Point(220, 120); - this.StatusPDTotalCountlabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.StatusPDTotalCountlabel.Location = new System.Drawing.Point(132, 72); + this.StatusPDTotalCountlabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.StatusPDTotalCountlabel.Name = "StatusPDTotalCountlabel"; - this.StatusPDTotalCountlabel.Size = new System.Drawing.Size(28, 30); + this.StatusPDTotalCountlabel.Size = new System.Drawing.Size(17, 18); this.StatusPDTotalCountlabel.TabIndex = 4; this.StatusPDTotalCountlabel.Text = "0"; // // StatusPDFinishedCountlabel // this.StatusPDFinishedCountlabel.AutoSize = true; - this.StatusPDFinishedCountlabel.Location = new System.Drawing.Point(220, 150); - this.StatusPDFinishedCountlabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.StatusPDFinishedCountlabel.Location = new System.Drawing.Point(132, 90); + this.StatusPDFinishedCountlabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.StatusPDFinishedCountlabel.Name = "StatusPDFinishedCountlabel"; - this.StatusPDFinishedCountlabel.Size = new System.Drawing.Size(28, 30); + this.StatusPDFinishedCountlabel.Size = new System.Drawing.Size(17, 18); this.StatusPDFinishedCountlabel.TabIndex = 3; this.StatusPDFinishedCountlabel.Text = "0"; // // StatusPDFinishedlabel // this.StatusPDFinishedlabel.AutoSize = true; - this.StatusPDFinishedlabel.Location = new System.Drawing.Point(103, 150); - this.StatusPDFinishedlabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.StatusPDFinishedlabel.Location = new System.Drawing.Point(62, 90); + this.StatusPDFinishedlabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.StatusPDFinishedlabel.Name = "StatusPDFinishedlabel"; - this.StatusPDFinishedlabel.Size = new System.Drawing.Size(58, 30); + this.StatusPDFinishedlabel.Size = new System.Drawing.Size(35, 18); this.StatusPDFinishedlabel.TabIndex = 2; this.StatusPDFinishedlabel.Text = "已:"; // // StatusPDTotallabel // this.StatusPDTotallabel.AutoSize = true; - this.StatusPDTotallabel.Location = new System.Drawing.Point(103, 120); - this.StatusPDTotallabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.StatusPDTotallabel.Location = new System.Drawing.Point(62, 72); + this.StatusPDTotallabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.StatusPDTotallabel.Name = "StatusPDTotallabel"; - this.StatusPDTotallabel.Size = new System.Drawing.Size(58, 30); + this.StatusPDTotallabel.Size = new System.Drawing.Size(35, 18); this.StatusPDTotallabel.TabIndex = 1; this.StatusPDTotallabel.Text = "总:"; // // StatusInfolabel // - this.StatusInfolabel.Location = new System.Drawing.Point(15, 43); - this.StatusInfolabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.StatusInfolabel.Location = new System.Drawing.Point(9, 26); + this.StatusInfolabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.StatusInfolabel.Name = "StatusInfolabel"; - this.StatusInfolabel.Size = new System.Drawing.Size(470, 77); + this.StatusInfolabel.Size = new System.Drawing.Size(282, 46); this.StatusInfolabel.TabIndex = 0; this.StatusInfolabel.Text = "状态信息"; this.StatusInfolabel.MouseHover += new System.EventHandler(this.StatusInfolabel_MouseHover); @@ -223,10 +224,10 @@ private void InitializeComponent() this.AutoSetcheckBox.AutoSize = true; this.AutoSetcheckBox.Checked = true; this.AutoSetcheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.AutoSetcheckBox.Location = new System.Drawing.Point(852, 90); - this.AutoSetcheckBox.Margin = new System.Windows.Forms.Padding(7); + this.AutoSetcheckBox.Location = new System.Drawing.Point(511, 54); + this.AutoSetcheckBox.Margin = new System.Windows.Forms.Padding(4); this.AutoSetcheckBox.Name = "AutoSetcheckBox"; - this.AutoSetcheckBox.Size = new System.Drawing.Size(155, 34); + this.AutoSetcheckBox.Size = new System.Drawing.Size(106, 22); this.AutoSetcheckBox.TabIndex = 9; this.AutoSetcheckBox.Text = "Auto-Set"; this.toolTip1.SetToolTip(this.AutoSetcheckBox, "从剪切板的链接中自动设置 ID"); @@ -235,10 +236,10 @@ private void InitializeComponent() // AlbumradioButton // this.AlbumradioButton.AutoSize = true; - this.AlbumradioButton.Location = new System.Drawing.Point(463, 93); - this.AlbumradioButton.Margin = new System.Windows.Forms.Padding(7); + this.AlbumradioButton.Location = new System.Drawing.Point(278, 56); + this.AlbumradioButton.Margin = new System.Windows.Forms.Padding(4); this.AlbumradioButton.Name = "AlbumradioButton"; - this.AlbumradioButton.Size = new System.Drawing.Size(94, 34); + this.AlbumradioButton.Size = new System.Drawing.Size(69, 22); this.AlbumradioButton.TabIndex = 10; this.AlbumradioButton.TabStop = true; this.AlbumradioButton.Text = "专辑"; @@ -246,6 +247,7 @@ private void InitializeComponent() // // AdvancedSettingsgroupBox // + this.AdvancedSettingsgroupBox.Controls.Add(this.LowDelaycheckBox); this.AdvancedSettingsgroupBox.Controls.Add(this.CookietextBox); this.AdvancedSettingsgroupBox.Controls.Add(this.CookieLabel); this.AdvancedSettingsgroupBox.Controls.Add(this.EncodingcomboBox); @@ -257,14 +259,49 @@ private void InitializeComponent() this.AdvancedSettingsgroupBox.Controls.Add(this.DelayMseclabel); this.AdvancedSettingsgroupBox.Controls.Add(this.LyricsStylenumericUpDown); this.AdvancedSettingsgroupBox.Controls.Add(this.LyricsStylelabel); - this.AdvancedSettingsgroupBox.Location = new System.Drawing.Point(30, 155); - this.AdvancedSettingsgroupBox.Margin = new System.Windows.Forms.Padding(7); + this.AdvancedSettingsgroupBox.Location = new System.Drawing.Point(18, 93); + this.AdvancedSettingsgroupBox.Margin = new System.Windows.Forms.Padding(4); this.AdvancedSettingsgroupBox.Name = "AdvancedSettingsgroupBox"; - this.AdvancedSettingsgroupBox.Padding = new System.Windows.Forms.Padding(7); - this.AdvancedSettingsgroupBox.Size = new System.Drawing.Size(500, 382); + this.AdvancedSettingsgroupBox.Padding = new System.Windows.Forms.Padding(4); + this.AdvancedSettingsgroupBox.Size = new System.Drawing.Size(300, 276); this.AdvancedSettingsgroupBox.TabIndex = 11; this.AdvancedSettingsgroupBox.TabStop = false; this.AdvancedSettingsgroupBox.Visible = false; + this.AdvancedSettingsgroupBox.Enter += new System.EventHandler(this.AdvancedSettingsgroupBox_Enter); + // + // LowDelaycheckBox + // + this.LowDelaycheckBox.AccessibleDescription = "选择此项将以更短的间隔在遇到错误时重新请求。"; + this.LowDelaycheckBox.AccessibleName = "短间隔模式"; + this.LowDelaycheckBox.AutoSize = true; + this.LowDelaycheckBox.Checked = true; + this.LowDelaycheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.LowDelaycheckBox.Location = new System.Drawing.Point(12, 201); + this.LowDelaycheckBox.Name = "LowDelaycheckBox"; + this.LowDelaycheckBox.Size = new System.Drawing.Size(124, 22); + this.LowDelaycheckBox.TabIndex = 24; + this.LowDelaycheckBox.Text = "短间隔模式"; + this.toolTip1.SetToolTip(this.LowDelaycheckBox, "选择此项将以更短的间隔在遇到错误时重新请求。"); + this.LowDelaycheckBox.UseVisualStyleBackColor = true; + this.LowDelaycheckBox.CheckedChanged += new System.EventHandler(this.LowDelaycheckBox_CheckedChanged); + // + // CookietextBox + // + this.CookietextBox.Location = new System.Drawing.Point(119, 161); + this.CookietextBox.Margin = new System.Windows.Forms.Padding(2); + this.CookietextBox.Name = "CookietextBox"; + this.CookietextBox.Size = new System.Drawing.Size(155, 28); + this.CookietextBox.TabIndex = 23; + // + // CookieLabel + // + this.CookieLabel.AutoSize = true; + this.CookieLabel.Location = new System.Drawing.Point(9, 163); + this.CookieLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.CookieLabel.Name = "CookieLabel"; + this.CookieLabel.Size = new System.Drawing.Size(107, 18); + this.CookieLabel.TabIndex = 22; + this.CookieLabel.Text = "登录Cookie:"; // // EncodingcomboBox // @@ -272,10 +309,10 @@ private void InitializeComponent() this.EncodingcomboBox.Items.AddRange(new object[] { "UTF-8", "GB2312"}); - this.EncodingcomboBox.Location = new System.Drawing.Point(279, 330); - this.EncodingcomboBox.Margin = new System.Windows.Forms.Padding(7); + this.EncodingcomboBox.Location = new System.Drawing.Point(167, 242); + this.EncodingcomboBox.Margin = new System.Windows.Forms.Padding(4); this.EncodingcomboBox.Name = "EncodingcomboBox"; - this.EncodingcomboBox.Size = new System.Drawing.Size(175, 38); + this.EncodingcomboBox.Size = new System.Drawing.Size(107, 26); this.EncodingcomboBox.TabIndex = 21; this.EncodingcomboBox.Text = "UTF-8"; this.toolTip1.SetToolTip(this.EncodingcomboBox, "歌词文件的字符编码"); @@ -284,13 +321,14 @@ private void InitializeComponent() // this.ReviseRawcheckBox.AutoSize = true; this.ReviseRawcheckBox.ForeColor = System.Drawing.SystemColors.ControlDark; - this.ReviseRawcheckBox.Location = new System.Drawing.Point(20, 332); - this.ReviseRawcheckBox.Margin = new System.Windows.Forms.Padding(7); + this.ReviseRawcheckBox.Location = new System.Drawing.Point(12, 246); + this.ReviseRawcheckBox.Margin = new System.Windows.Forms.Padding(4); this.ReviseRawcheckBox.Name = "ReviseRawcheckBox"; - this.ReviseRawcheckBox.Size = new System.Drawing.Size(170, 34); + this.ReviseRawcheckBox.Size = new System.Drawing.Size(115, 22); this.ReviseRawcheckBox.TabIndex = 20; this.ReviseRawcheckBox.Text = "ReviseRaw"; this.ReviseRawcheckBox.UseVisualStyleBackColor = true; + this.ReviseRawcheckBox.CheckedChanged += new System.EventHandler(this.ReviseRawcheckBox_CheckedChanged); // // Savelabel // @@ -298,10 +336,10 @@ private void InitializeComponent() this.Savelabel.Cursor = System.Windows.Forms.Cursors.Hand; this.Savelabel.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.Savelabel.ForeColor = System.Drawing.Color.Blue; - this.Savelabel.Location = new System.Drawing.Point(387, 35); - this.Savelabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.Savelabel.Location = new System.Drawing.Point(232, 21); + this.Savelabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.Savelabel.Name = "Savelabel"; - this.Savelabel.Size = new System.Drawing.Size(37, 15); + this.Savelabel.Size = new System.Drawing.Size(44, 18); this.Savelabel.TabIndex = 19; this.Savelabel.Text = "保存"; this.toolTip1.SetToolTip(this.Savelabel, "软件将在下次启动时自动加载已保存的高级设置"); @@ -315,10 +353,10 @@ private void InitializeComponent() "[track number]. [title].lrc", "[artist] - [title].lrc", "[title] - [artist].lrc"}); - this.FilenamePatterncomboBox.Location = new System.Drawing.Point(20, 207); - this.FilenamePatterncomboBox.Margin = new System.Windows.Forms.Padding(7); + this.FilenamePatterncomboBox.Location = new System.Drawing.Point(12, 124); + this.FilenamePatterncomboBox.Margin = new System.Windows.Forms.Padding(4); this.FilenamePatterncomboBox.Name = "FilenamePatterncomboBox"; - this.FilenamePatterncomboBox.Size = new System.Drawing.Size(434, 38); + this.FilenamePatterncomboBox.Size = new System.Drawing.Size(262, 26); this.FilenamePatterncomboBox.TabIndex = 18; this.FilenamePatterncomboBox.Text = "[title].lrc"; this.toolTip1.SetToolTip(this.FilenamePatterncomboBox, "支持:[title][track number][album][artist]"); @@ -326,10 +364,10 @@ private void InitializeComponent() // FilenamePatternLabel // this.FilenamePatternLabel.AutoSize = true; - this.FilenamePatternLabel.Location = new System.Drawing.Point(15, 170); - this.FilenamePatternLabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.FilenamePatternLabel.Location = new System.Drawing.Point(9, 102); + this.FilenamePatternLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.FilenamePatternLabel.Name = "FilenamePatternLabel"; - this.FilenamePatternLabel.Size = new System.Drawing.Size(178, 30); + this.FilenamePatternLabel.Size = new System.Drawing.Size(107, 18); this.FilenamePatternLabel.TabIndex = 17; this.FilenamePatternLabel.Text = "文件名样式:"; // @@ -340,8 +378,8 @@ private void InitializeComponent() 0, 0, 0}); - this.DelayMsecnumericUpDown.Location = new System.Drawing.Point(223, 97); - this.DelayMsecnumericUpDown.Margin = new System.Windows.Forms.Padding(7); + this.DelayMsecnumericUpDown.Location = new System.Drawing.Point(134, 58); + this.DelayMsecnumericUpDown.Margin = new System.Windows.Forms.Padding(4); this.DelayMsecnumericUpDown.Maximum = new decimal(new int[] { 400, 0, @@ -353,7 +391,7 @@ private void InitializeComponent() 0, -2147483648}); this.DelayMsecnumericUpDown.Name = "DelayMsecnumericUpDown"; - this.DelayMsecnumericUpDown.Size = new System.Drawing.Size(95, 42); + this.DelayMsecnumericUpDown.Size = new System.Drawing.Size(57, 28); this.DelayMsecnumericUpDown.TabIndex = 16; this.toolTip1.SetToolTip(this.DelayMsecnumericUpDown, "100 意味着 1sec"); this.DelayMsecnumericUpDown.Value = new decimal(new int[] { @@ -365,35 +403,35 @@ private void InitializeComponent() // DelayMseclabel // this.DelayMseclabel.AutoSize = true; - this.DelayMseclabel.Location = new System.Drawing.Point(13, 100); - this.DelayMseclabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.DelayMseclabel.Location = new System.Drawing.Point(8, 60); + this.DelayMseclabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.DelayMseclabel.Name = "DelayMseclabel"; - this.DelayMseclabel.Size = new System.Drawing.Size(148, 30); + this.DelayMseclabel.Size = new System.Drawing.Size(89, 18); this.DelayMseclabel.TabIndex = 15; this.DelayMseclabel.Text = "延迟Msec:"; this.toolTip1.SetToolTip(this.DelayMseclabel, "How long should the translyrics be delayed?"); // // LyricsStylenumericUpDown // - this.LyricsStylenumericUpDown.Location = new System.Drawing.Point(223, 40); - this.LyricsStylenumericUpDown.Margin = new System.Windows.Forms.Padding(7); + this.LyricsStylenumericUpDown.Location = new System.Drawing.Point(134, 24); + this.LyricsStylenumericUpDown.Margin = new System.Windows.Forms.Padding(4); this.LyricsStylenumericUpDown.Maximum = new decimal(new int[] { 1, 0, 0, 0}); this.LyricsStylenumericUpDown.Name = "LyricsStylenumericUpDown"; - this.LyricsStylenumericUpDown.Size = new System.Drawing.Size(75, 42); + this.LyricsStylenumericUpDown.Size = new System.Drawing.Size(45, 28); this.LyricsStylenumericUpDown.TabIndex = 14; this.toolTip1.SetToolTip(this.LyricsStylenumericUpDown, "0:歌词原文和翻译将分行\r\n1:歌词原文和翻译将尽可能同行"); // // LyricsStylelabel // this.LyricsStylelabel.AutoSize = true; - this.LyricsStylelabel.Location = new System.Drawing.Point(15, 45); - this.LyricsStylelabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.LyricsStylelabel.Location = new System.Drawing.Point(9, 27); + this.LyricsStylelabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.LyricsStylelabel.Name = "LyricsStylelabel"; - this.LyricsStylelabel.Size = new System.Drawing.Size(148, 30); + this.LyricsStylelabel.Size = new System.Drawing.Size(89, 18); this.LyricsStylelabel.TabIndex = 13; this.LyricsStylelabel.Text = "歌词样式:"; this.toolTip1.SetToolTip(this.LyricsStylelabel, "Different styles for different environment."); @@ -401,10 +439,10 @@ private void InitializeComponent() // AdvancedSettingscheckBox // this.AdvancedSettingscheckBox.AutoSize = true; - this.AdvancedSettingscheckBox.Location = new System.Drawing.Point(35, 150); - this.AdvancedSettingscheckBox.Margin = new System.Windows.Forms.Padding(7); + this.AdvancedSettingscheckBox.Location = new System.Drawing.Point(21, 90); + this.AdvancedSettingscheckBox.Margin = new System.Windows.Forms.Padding(4); this.AdvancedSettingscheckBox.Name = "AdvancedSettingscheckBox"; - this.AdvancedSettingscheckBox.Size = new System.Drawing.Size(155, 34); + this.AdvancedSettingscheckBox.Size = new System.Drawing.Size(106, 22); this.AdvancedSettingscheckBox.TabIndex = 12; this.AdvancedSettingscheckBox.Text = "高级设置"; this.toolTip1.SetToolTip(this.AdvancedSettingscheckBox, "More features but less stable."); @@ -425,36 +463,19 @@ private void InitializeComponent() this.needhelplabel.Cursor = System.Windows.Forms.Cursors.Hand; this.needhelplabel.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.needhelplabel.ForeColor = System.Drawing.Color.Blue; - this.needhelplabel.Location = new System.Drawing.Point(847, 32); - this.needhelplabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); + this.needhelplabel.Location = new System.Drawing.Point(508, 19); + this.needhelplabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.needhelplabel.Name = "needhelplabel"; - this.needhelplabel.Size = new System.Drawing.Size(87, 15); + this.needhelplabel.Size = new System.Drawing.Size(98, 18); this.needhelplabel.TabIndex = 19; this.needhelplabel.Text = "Need Help?"; this.needhelplabel.Click += new System.EventHandler(this.needhelplabel_Click); // - // CookieLabel - // - this.CookieLabel.AutoSize = true; - this.CookieLabel.Location = new System.Drawing.Point(15, 272); - this.CookieLabel.Margin = new System.Windows.Forms.Padding(7, 0, 7, 0); - this.CookieLabel.Name = "CookieLabel"; - this.CookieLabel.Size = new System.Drawing.Size(178, 30); - this.CookieLabel.TabIndex = 22; - this.CookieLabel.Text = "登录Cookie:"; - // - // CookietextBox - // - this.CookietextBox.Location = new System.Drawing.Point(198, 269); - this.CookietextBox.Name = "CookietextBox"; - this.CookietextBox.Size = new System.Drawing.Size(256, 42); - this.CookietextBox.TabIndex = 23; - // // LrcDownloader // - this.AutoScaleDimensions = new System.Drawing.SizeF(15F, 30F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1080, 553); + this.ClientSize = new System.Drawing.Size(648, 382); this.Controls.Add(this.needhelplabel); this.Controls.Add(this.AdvancedSettingscheckBox); this.Controls.Add(this.AdvancedSettingsgroupBox); @@ -471,7 +492,7 @@ private void InitializeComponent() this.Controls.Add(this.IDtextBox); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(7); + this.Margin = new System.Windows.Forms.Padding(4); this.MaximizeBox = false; this.Name = "LrcDownloader"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; @@ -522,5 +543,6 @@ private void InitializeComponent() private System.Windows.Forms.ComboBox EncodingcomboBox; private System.Windows.Forms.TextBox CookietextBox; private System.Windows.Forms.Label CookieLabel; + private System.Windows.Forms.CheckBox LowDelaycheckBox; } } \ No newline at end of file diff --git a/LrcHelper/LrcDownloader.cs b/LrcHelper/LrcDownloader.cs index 2544653..f1e7e58 100644 --- a/LrcHelper/LrcDownloader.cs +++ b/LrcHelper/LrcDownloader.cs @@ -258,7 +258,7 @@ private void GETbutton_Click(object sender, EventArgs e) private string DownloadLrc(string folderPath, string filenamePatern, Music music, int ModeIIndex, int DelayMsc, out LyricsStatus status,out string filePath, string fileEncoding = "UTF-8",string revisedsContentOriLyricsForUserReviseFunc = null, string revisedsContentTransLyricsForUserReviseFunc = null) { ExtendedLyrics l = new ExtendedLyrics(music.ID); - l.FetchOnlineLyrics(revisedsContentOriLyricsForUserReviseFunc, revisedsContentTransLyricsForUserReviseFunc); + l.FetchOnlineLyrics(revisedsContentOriLyricsForUserReviseFunc, revisedsContentTransLyricsForUserReviseFunc, LowDelaycheckBox.Checked); string lyricText = l.GetCustomLyric(ModeIIndex, DelayMsc); filePath = ""; if (lyricText != "") @@ -322,7 +322,7 @@ private void Savelabel_Click(object sender, EventArgs e) { try { - File.WriteAllText(".\\AdvancedSettings.txt", string.Format("Version:{0}\r\nTime:{1}\r\nLyricsStyle:{2}\r\nDelayMsec:{3}\r\nFilenamePattern:{4}\r\nEncoding:{5}\r\nCookie:{6}\r\n***DO NOT CHANGE ANY TEXT AND/OR ENCODING***\r\n***If you don't want to use these settings ever, just delete this file.***", FileVersionInfo.GetVersionInfo(Application.ExecutablePath).FileVersion, DateTime.Now.ToString(), LyricsStylenumericUpDown.Value.ToString(), DelayMsecnumericUpDown.Value.ToString(), FilenamePatterncomboBox.Text, EncodingcomboBox.Text,CookietextBox.Text), Encoding.UTF8); + File.WriteAllText(".\\AdvancedSettings.txt", string.Format("Version:{0}\r\nTime:{1}\r\nLyricsStyle:{2}\r\nDelayMsec:{3}\r\nFilenamePattern:{4}\r\nEncoding:{5}\r\nCookie:{6}\r\nLowDelay:{7}\r\n***DO NOT CHANGE ANY TEXT AND/OR ENCODING***\r\n***If you don't want to use these settings ever, just delete this file.***", FileVersionInfo.GetVersionInfo(Application.ExecutablePath).FileVersion, DateTime.Now.ToString(), LyricsStylenumericUpDown.Value.ToString(), DelayMsecnumericUpDown.Value.ToString(), FilenamePatterncomboBox.Text, EncodingcomboBox.Text,CookietextBox.Text, LowDelaycheckBox.Checked), Encoding.UTF8); } catch (Exception) { @@ -343,6 +343,7 @@ private void LrcDownloader_Load(object sender, EventArgs e) FilenamePatterncomboBox.Text = Regex.Match(settings, @"(?<=FilenamePattern:).+?(?=\r\n)", RegexOptions.IgnoreCase).Value.ToString(); EncodingcomboBox.Text = Regex.Match(settings, @"(?<=Encoding:).+?(?=\r\n)", RegexOptions.IgnoreCase).Value.ToString(); CookietextBox.Text = Regex.Match(settings, @"(?<=Cookie:).+?(?=\r\n)", RegexOptions.IgnoreCase).Value.ToString(); + LowDelaycheckBox.Checked = Convert.ToBoolean(Regex.Match(settings, @"(?<=LowDelay:).+?(?=\r\n)", RegexOptions.IgnoreCase).Value.ToString()); } } @@ -351,5 +352,19 @@ private void StatusInfolabel_MouseHover(object sender, EventArgs e) toolTip1.SetToolTip(StatusInfolabel, StatusInfolabel.Text);//防止label显示不完文本,专门浮动出来 } + private void AdvancedSettingsgroupBox_Enter(object sender, EventArgs e) + { + + } + + private void ReviseRawcheckBox_CheckedChanged(object sender, EventArgs e) + { + + } + + private void LowDelaycheckBox_CheckedChanged(object sender, EventArgs e) + { + + } } } diff --git a/LrcHelper/LrcHelper.csproj b/LrcHelper/LrcHelper.csproj index 878c53b..38372ce 100644 --- a/LrcHelper/LrcHelper.csproj +++ b/LrcHelper/LrcHelper.csproj @@ -9,7 +9,7 @@ Properties LrcHelper 163lrc - v4.5 + v4.8 512 true false diff --git a/LrcHelper/NeteaseMusic.cs b/LrcHelper/NeteaseMusic.cs index 36d4acb..d9a0684 100644 --- a/LrcHelper/NeteaseMusic.cs +++ b/LrcHelper/NeteaseMusic.cs @@ -6,6 +6,7 @@ using ludoux.LrcHelper.SharedFramework; using System.ComponentModel; using Newtonsoft.Json; +using System.Threading; namespace ludoux.LrcHelper.NeteaseMusic { @@ -69,7 +70,7 @@ public ExtendedLyrics(long ID) /// 从云端取得该对象的歌词信息并记录 /// /// 用户是否介入修改 sContent,当软件自动下载歌词报错后,才应该在启用此选项 - internal void FetchOnlineLyrics(string revisedsContentOriLyricsForUserReviseFunc, string revisedsContentTransLyricsForUserReviseFunc) + internal void FetchOnlineLyrics(string revisedsContentOriLyricsForUserReviseFunc, string revisedsContentTransLyricsForUserReviseFunc, bool LowDelaycheckBoxChecked) { bool userReviseFunc = false; if (revisedsContentOriLyricsForUserReviseFunc != null) @@ -84,6 +85,7 @@ internal void FetchOnlineLyrics(string revisedsContentOriLyricsForUserReviseFunc try { + Start: sContent = hr.GetContent("https://music.163.com/api/song/detail/?id=" + id + "&ids=[" + id + "]");//这个是仅对确定歌词状态有用的 if (Regex.IsMatch(sContent, @"^{""songs"":\[]") || Regex.IsMatch(sContent, @"^{""code"":400")) { ErrorLog += ""; Status = LyricsStatus.ERROR; return; } @@ -106,7 +108,13 @@ internal void FetchOnlineLyrics(string revisedsContentOriLyricsForUserReviseFunc sContent = revisedsContentOriLyricsForUserReviseFunc; if (!Regex.IsMatch(sContent, @"""lyric""")) - { ErrorLog += ""; return; } + if (Regex.IsMatch(sContent, @"""操作频繁,请稍候再试""")) + if (!LowDelaycheckBoxChecked) + { Thread.Sleep(10000);goto Start; } + else + { Thread.Sleep(500); goto Start; } + else + { ErrorLog += ""; return; } sLRC = Regex.Match(sContent, @"(?<=""lyric"":"").*?(?="",""code)").Value; tempOriLyric.ArrangeLyrics(sLRC); hasOriLyrics = true; diff --git a/LrcHelper/Properties/Resources.Designer.cs b/LrcHelper/Properties/Resources.Designer.cs index 52f1fd8..c6abd70 100644 --- a/LrcHelper/Properties/Resources.Designer.cs +++ b/LrcHelper/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace LrcHelper.Properties { // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // (以 /str 作为命令选项),或重新生成 VS 项目。 - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -47,8 +47,8 @@ internal Resources() { } /// - /// 重写当前线程的 CurrentUICulture 属性 - /// 重写当前线程的 CurrentUICulture 属性。 + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { diff --git a/LrcHelper/Properties/Settings.Designer.cs b/LrcHelper/Properties/Settings.Designer.cs index 0f726b4..e5146c0 100644 --- a/LrcHelper/Properties/Settings.Designer.cs +++ b/LrcHelper/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace LrcHelper.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));