From e831398e6871d11b184f8b1775d74d8f9c617106 Mon Sep 17 00:00:00 2001 From: Lu Chang Date: Mon, 29 Jul 2019 12:55:19 +0800 Subject: [PATCH] 2.1.0 Released. -Supported playlist with 1000+ music #8 --- LrcHelper/LrcDownloader.Designer.cs | 14 +++++++------- LrcHelper/NeteaseMusic.cs | 10 +++++----- LrcHelper/Properties/AssemblyInfo.cs | 2 +- UpdateInfo/UpInfo.txt | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/LrcHelper/LrcDownloader.Designer.cs b/LrcHelper/LrcDownloader.Designer.cs index fc243b5..7607f9a 100644 --- a/LrcHelper/LrcDownloader.Designer.cs +++ b/LrcHelper/LrcDownloader.Designer.cs @@ -85,7 +85,7 @@ private void InitializeComponent() // Functionlabel // this.Functionlabel.AutoSize = true; - this.Functionlabel.Location = new System.Drawing.Point(18, 58); + 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(71, 18); @@ -107,7 +107,7 @@ private void InitializeComponent() // PlaylistradioButton // this.PlaylistradioButton.AutoSize = true; - this.PlaylistradioButton.Location = new System.Drawing.Point(213, 56); + 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(69, 22); @@ -130,7 +130,7 @@ private void InitializeComponent() // Copyrightlabel // this.Copyrightlabel.AutoSize = true; - this.Copyrightlabel.Location = new System.Drawing.Point(454, 4); + this.Copyrightlabel.Location = new System.Drawing.Point(337, 251); this.Copyrightlabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.Copyrightlabel.Name = "Copyrightlabel"; this.Copyrightlabel.Size = new System.Drawing.Size(251, 36); @@ -220,7 +220,7 @@ 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(417, 57); + 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(106, 22); @@ -232,7 +232,7 @@ private void InitializeComponent() // AlbumradioButton // this.AlbumradioButton.AutoSize = true; - this.AlbumradioButton.Location = new System.Drawing.Point(328, 56); + 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(69, 22); @@ -405,7 +405,7 @@ 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(608, 56); + 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(98, 18); @@ -417,7 +417,7 @@ private void InitializeComponent() // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(714, 302); + this.ClientSize = new System.Drawing.Size(647, 302); this.Controls.Add(this.needhelplabel); this.Controls.Add(this.AdvancedSettingscheckBox); this.Controls.Add(this.AdvancedSettingsgroupBox); diff --git a/LrcHelper/NeteaseMusic.cs b/LrcHelper/NeteaseMusic.cs index 190b005..5921e53 100644 --- a/LrcHelper/NeteaseMusic.cs +++ b/LrcHelper/NeteaseMusic.cs @@ -10,7 +10,7 @@ namespace ludoux.LrcHelper.NeteaseMusic { class HttpRequest { - public string GetContent(string sURL) + public string GetContent(string sURL, string UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0") { string sContent = ""; //Content @@ -21,7 +21,7 @@ public string GetContent(string sURL) wrGETURL.Referer= "https://music.163.com"; //wrGETURL.Headers.Set(HttpRequestHeader.Cookie, "appver=1.4.0; os=uwp; osver=10.0.15063.296"); //返回cheating - wrGETURL.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0"; + wrGETURL.UserAgent = UserAgent; Stream objStream = wrGETURL.GetResponse().GetResponseStream(); StreamReader objReader = new StreamReader(objStream); while (sLine != null) @@ -253,12 +253,12 @@ private void fetchInfo() { string sContent; HttpRequest hr = new HttpRequest(); - sContent = hr.GetContent("https://music.163.com/api/playlist/detail?id=" + id); - MatchCollection mc = Regex.Matches(sContent, @"(?<=""id"":)\d*?(?=,""position)");//正则匹配歌曲的ID + sContent = hr.GetContent("https://music.163.com/api/v3/playlist/detail?id=" + id + @"&c=[{""id"":""" + id + @"""}]"); + MatchCollection mc = Regex.Matches(sContent, @"(?<={""id"":)\d+(?=,""v"":)");//正则匹配歌曲的ID for (int i = 0; i < mc.Count; i++) _songidInPlaylist.Add(Convert.ToInt64(mc[i].Value.ToString())); - _name = Regex.Match(sContent, @"(?<=,""name"":"").*?(?="",""id"")").Value; + _name = Regex.Match(Regex.Match(sContent, @"(?<=trackIds).+?(?=,""shareCount)" ).Value, @"(?<=name"":"").+?(?="",""id)").Value ; } public Playlist(long id) { diff --git a/LrcHelper/Properties/AssemblyInfo.cs b/LrcHelper/Properties/AssemblyInfo.cs index f5a2142..f97ccf8 100644 --- a/LrcHelper/Properties/AssemblyInfo.cs +++ b/LrcHelper/Properties/AssemblyInfo.cs @@ -34,6 +34,6 @@ // 方法是按如下所示使用“*”: : // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("2.0.13.0")] +[assembly: AssemblyFileVersion("2.1.0.0")] [assembly: NeutralResourcesLanguage("en-001")] diff --git a/UpdateInfo/UpInfo.txt b/UpdateInfo/UpInfo.txt index c6c9da3..452f9cb 100644 --- a/UpdateInfo/UpInfo.txt +++ b/UpdateInfo/UpInfo.txt @@ -2,7 +2,7 @@ ;ATTENTION ;Software will ask for this file and check the lastest version. ;DO NOT change the style of this file. -;+2019-6-17: https://api.ludoux.com/163lrcwin/update switch to new channel. +;+2019-6-17: https://api.ludoux.com/163lrcwin/update switch to new channel. This file has been archived. ;=================== ;Software with these version WILL NOT check update.If is existed, Software with ANY version WILL NOT check.