fix: pair each QQ vkey filename with its songmid
This commit is contained in:
1 parent
ec9d5e78f7
commit
a8a5204a24
2 files changed
+6
-3
No files matched your search
@@ -49,6 +49,9 @@ func (c *Client) PlayURL(ctx context.Context, songMID string) (string, error) {
|
||||
"M800" + songMID + songMID + ".mp3",
|
||||
"M500" + songMID + songMID + ".mp3",
|
||||
}
|
||||
// vkey 接口按下标配对 filename 和 songmid,不配对的文件一律返回不存在。
|
||||
songmids := []string{songMID, songMID, songMID}
|
||||
songtypes := []int{0, 0, 0}
|
||||
payload, err := json.Marshal(map[string]any{
|
||||
"req_1": map[string]any{
|
||||
"module": "music.vkey.GetVkey",
|
||||
@@ -56,8 +59,8 @@ func (c *Client) PlayURL(ctx context.Context, songMID string) (string, error) {
|
||||
"param": map[string]any{
|
||||
"filename": filenames,
|
||||
"guid": "0",
|
||||
"songmid": []string{songMID},
|
||||
"songtype": []int{0},
|
||||
"songmid": songmids,
|
||||
"songtype": songtypes,
|
||||
"uin": "0",
|
||||
"loginflag": 1,
|
||||
"platform": "20",
|
||||
|
||||
@@ -37,7 +37,7 @@ func checkPlayURLRequest(t *testing.T, r *http.Request) {
|
||||
t.Errorf("播放地址请求的方法和模块 = %q %q", payload.Req1.Method, payload.Req1.Module)
|
||||
}
|
||||
wantFilenames := []string{"F000idid.flac", "M800idid.mp3", "M500idid.mp3"}
|
||||
if !slices.Equal(payload.Req1.Param.Filenames, wantFilenames) || !slices.Equal(payload.Req1.Param.SongMIDs, []string{"id"}) {
|
||||
if !slices.Equal(payload.Req1.Param.Filenames, wantFilenames) || !slices.Equal(payload.Req1.Param.SongMIDs, []string{"id", "id", "id"}) {
|
||||
t.Errorf("播放地址请求的参数 = %#v", payload.Req1.Param)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user