mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
简单修了下网易点歌 (#200)
This commit is contained in:
parent
3553683bb1
commit
c0fa7efb27
@ -140,22 +140,14 @@ func cloud163(keyword string) message.MessageSegment {
|
|||||||
"User-Agent": []string{"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"},
|
"User-Agent": []string{"Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"},
|
||||||
}
|
}
|
||||||
data := url.Values{
|
data := url.Values{
|
||||||
"offset": []string{"0"},
|
"keywords": []string{keyword},
|
||||||
"total": []string{"true"},
|
|
||||||
"limit": []string{"9"},
|
|
||||||
"type": []string{"1"},
|
|
||||||
"s": []string{keyword},
|
|
||||||
}
|
}
|
||||||
// 搜索音乐信息 第一首歌
|
// 通过API 搜索音乐信息 第一首
|
||||||
info := gjson.ParseBytes(netPost("http://music.163.com/api/search/pc", data, headers)).Get("result.songs.0")
|
|
||||||
// 返回音乐卡片
|
// 返回音乐卡片
|
||||||
return message.CustomMusic(
|
return message.Music("163", gjson.ParseBytes(netPost("https://nemapi.windis.xyz/search", data, headers)).Get("result.songs.0.id").Int())
|
||||||
fmt.Sprintf("http://y.music.163.com/m/song?id=%d", info.Get("id").Int()),
|
|
||||||
fmt.Sprintf("http://music.163.com/song/media/outer/url?id=%d.mp3", info.Get("id").Int()),
|
|
||||||
info.Get("name").Str,
|
|
||||||
).Add("content", info.Get("artists.0.name").Str).Add("image", info.Get("album.blurPicUrl").Str)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// qqmusic 返回QQ音乐卡片
|
// qqmusic 返回QQ音乐卡片
|
||||||
func qqmusic(keyword string) message.MessageSegment {
|
func qqmusic(keyword string) message.MessageSegment {
|
||||||
// 搜索音乐信息 第一首歌
|
// 搜索音乐信息 第一首歌
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user