diff --git a/src/ZonyLrcTools.Cli/Infrastructure/Lyric/LyricDownloader.cs b/src/ZonyLrcTools.Cli/Infrastructure/Lyric/LyricDownloader.cs index 65465b3..96aa19a 100644 --- a/src/ZonyLrcTools.Cli/Infrastructure/Lyric/LyricDownloader.cs +++ b/src/ZonyLrcTools.Cli/Infrastructure/Lyric/LyricDownloader.cs @@ -16,7 +16,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric var args = new LyricDownloaderArgs(songName, artist); await ValidateAsync(args); var downloadDataBytes = await DownloadDataAsync(args); - return await GenerateLyricAsync(downloadDataBytes); + return await GenerateLyricAsync(downloadDataBytes, args); } protected virtual ValueTask ValidateAsync(LyricDownloaderArgs args) @@ -36,6 +36,6 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric protected abstract ValueTask DownloadDataAsync(LyricDownloaderArgs args); - protected abstract ValueTask GenerateLyricAsync(byte[] data); + protected abstract ValueTask GenerateLyricAsync(byte[] data, LyricDownloaderArgs args); } } \ No newline at end of file diff --git a/src/ZonyLrcTools.Cli/Infrastructure/Lyric/NetEase/NetEaseLyricDownloader.cs b/src/ZonyLrcTools.Cli/Infrastructure/Lyric/NetEase/NetEaseLyricDownloader.cs index 0c881d4..ee82f63 100644 --- a/src/ZonyLrcTools.Cli/Infrastructure/Lyric/NetEase/NetEaseLyricDownloader.cs +++ b/src/ZonyLrcTools.Cli/Infrastructure/Lyric/NetEase/NetEaseLyricDownloader.cs @@ -19,6 +19,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.NetEase private const string NetEaseSearchMusicUrl = @"https://music.163.com/api/search/get/web"; private const string NetEaseGetLyricUrl = @"https://music.163.com/api/song/lyric"; + private const string NetEaseRequestReferer = @"https://music.163.com"; private const string NetEaseRequestContentType = @"application/x-www-form-urlencoded"; @@ -54,7 +55,7 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.NetEase return Encoding.UTF8.GetBytes(lyricResponse); } - protected override async ValueTask GenerateLyricAsync(byte[] data) + protected override async ValueTask GenerateLyricAsync(byte[] data, LyricDownloaderArgs args) { await ValueTask.CompletedTask;