Skip to content

Commit

Permalink
fix: Fix the problem of QQ lyrics downloader prompting error.
Browse files Browse the repository at this point in the history
The reason for this is that the old API has been deprecated.
  • Loading branch information
real-zony committed Jul 25, 2022
1 parent 950652c commit 0772f58
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,26 @@ namespace ZonyLrcTools.Cli.Infrastructure.Lyric.QQMusic.JsonModel
{
public class SongSearchRequest
{
[JsonProperty("remoteplace")] public string RemotePlace { get; set; }
[JsonProperty("format")]
public string Format { get; protected set; }

[JsonProperty("p")] public int Page { get; set; }
[JsonProperty("inCharset")]
public string InCharset { get; protected set; }

[JsonProperty("n")] public int Limit { get; set; }

[JsonProperty("w")] public string Keyword { get; set; }

[JsonProperty("format")] public string ResultFormat { get; set; }

[JsonProperty("inCharset")] public string InCharset { get; set; }

[JsonProperty("outCharset")] public string OutCharset { get; set; }

[JsonProperty("platform")] public string Platform { get; set; }
[JsonProperty("outCharset")]
public string OutCharset { get; protected set; }

[JsonProperty("platform")]
public string Platform { get; protected set; }

[JsonProperty("key")]
public string Keyword { get; protected set; }

protected SongSearchRequest()
{
RemotePlace = "txt.yqq.song";
Page = 1;
Limit = 5;
ResultFormat = "json";
InCharset = "utf8";
OutCharset = "utf8";
Platform = "yqq";
Format = "json";
InCharset = OutCharset = "utf-8";
Platform = "yqq.json";
}

public SongSearchRequest(string musicName, string artistName) : this()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public class QQMusicInnerDataModel

public class QQMusicInnerSongModel
{
[JsonProperty("list")] public List<QQMusicInnerSongItem> SongItems { get; set; }
[JsonProperty("itemlist")] public List<QQMusicInnerSongItem> SongItems { get; set; }
}

public class QQMusicInnerSongItem
{
[JsonProperty("songmid")] public string SongId { get; set; }
[JsonProperty("mid")] public string SongId { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public class QQLyricDownloader : LyricDownloader
private readonly IWarpHttpClient _warpHttpClient;
private readonly ILyricItemCollectionFactory _lyricItemCollectionFactory;

private const string QQSearchMusicUrl = @"https://c.y.qq.com/soso/fcgi-bin/client_search_cp";
// private const string QQSearchMusicUrl = @"https://c.y.qq.com/soso/fcgi-bin/client_search_cp";
private const string QQSearchMusicUrl = @"https://c.y.qq.com/splcloud/fcgi-bin/smartbox_new.fcg";
private const string QQGetLyricUrl = @"https://c.y.qq.com/lyric/fcgi-bin/fcg_query_lyric_new.fcg";

private const string QQMusicRequestReferer = @"https://y.qq.com/";
Expand Down

0 comments on commit 0772f58

Please sign in to comment.