Skip to content

Commit c0fa7ef

Browse files
author
MoeMagicMango
authored
简单修了下网易点歌 (#200)
1 parent 3553683 commit c0fa7ef

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

plugin/music/selecter.go

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -140,22 +140,14 @@ func cloud163(keyword string) message.MessageSegment {
140140
"User-Agent": []string{"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"},
141141
}
142142
data := url.Values{
143-
"offset": []string{"0"},
144-
"total": []string{"true"},
145-
"limit": []string{"9"},
146-
"type": []string{"1"},
147-
"s": []string{keyword},
143+
"keywords": []string{keyword},
148144
}
149-
// 搜索音乐信息 第一首歌
150-
info := gjson.ParseBytes(netPost("http://music.163.com/api/search/pc", data, headers)).Get("result.songs.0")
151-
// 返回音乐卡片
152-
return message.CustomMusic(
153-
fmt.Sprintf("http://y.music.163.com/m/song?id=%d", info.Get("id").Int()),
154-
fmt.Sprintf("http://music.163.com/song/media/outer/url?id=%d.mp3", info.Get("id").Int()),
155-
info.Get("name").Str,
156-
).Add("content", info.Get("artists.0.name").Str).Add("image", info.Get("album.blurPicUrl").Str)
145+
// 通过API 搜索音乐信息 第一首
146+
// 返回音乐卡片
147+
return message.Music("163", gjson.ParseBytes(netPost("https://nemapi.windis.xyz/search", data, headers)).Get("result.songs.0.id").Int())
157148
}
158149

150+
159151
// qqmusic 返回QQ音乐卡片
160152
func qqmusic(keyword string) message.MessageSegment {
161153
// 搜索音乐信息 第一首歌

0 commit comments

Comments
 (0)