diff --git a/src/ZonyLrcTools.Cli/Infrastructure/Lyric/NetEase/JsonModel/SongSearchRequest.cs b/src/ZonyLrcTools.Cli/Infrastructure/Lyric/NetEase/JsonModel/SongSearchRequest.cs index 1b2b423..0056812 100644 --- a/src/ZonyLrcTools.Cli/Infrastructure/Lyric/NetEase/JsonModel/SongSearchRequest.cs +++ b/src/ZonyLrcTools.Cli/Infrastructure/Lyric/NetEase/JsonModel/SongSearchRequest.cs @@ -1,4 +1,5 @@ using System.Text; +using System.Text.RegularExpressions; using System.Web; using Newtonsoft.Json; @@ -53,6 +54,10 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.NetEase.JsonModel public SongSearchRequest(string musicName, string artistName) : this() { + // Remove all the brackets and the content inside them. + var regex = new Regex(@"\([^)]*\)"); + musicName = regex.Replace(musicName, string.Empty); + SearchKey = HttpUtility.UrlEncode($"{musicName}+{artistName}", Encoding.UTF8); } } diff --git a/tests/ZonyLrcTools.Tests/Infrastructure/Lyric/NetEaseLyricDownloaderTests.cs b/tests/ZonyLrcTools.Tests/Infrastructure/Lyric/NetEaseLyricDownloaderTests.cs index 92fb102..2971889 100644 --- a/tests/ZonyLrcTools.Tests/Infrastructure/Lyric/NetEaseLyricDownloaderTests.cs +++ b/tests/ZonyLrcTools.Tests/Infrastructure/Lyric/NetEaseLyricDownloaderTests.cs @@ -39,7 +39,7 @@ namespace ZonyLrcTools.Tests.Infrastructure.Lyric { var lyric = await _lyricDownloader.DownloadAsync("シンデレラ (Giga First Night Remix)", "DECO 27 ギガP"); lyric.ShouldNotBeNull(); - lyric.IsPruneMusic.ShouldBe(true); + lyric.IsPruneMusic.ShouldBe(false); } [Fact]