修复网易云点歌API失效(405)问题 (#303)

* Update main.go

* Update selecter.go

* Update struct.go

* Update main.go
This commit is contained in:
方柳煜 2022-07-06 13:44:24 +08:00 committed by GitHub
parent e6c00e9b68
commit 192c2a8bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

@ -49,9 +49,9 @@ func init() { // 插件主体
"- 设置猜歌缓存歌库路径 [绝对路径]\n" + "- 设置猜歌缓存歌库路径 [绝对路径]\n" +
"- 设置猜歌本地 [true/false]\n" + "- 设置猜歌本地 [true/false]\n" +
"- 设置猜歌Api [true/false]\n" + "- 设置猜歌Api [true/false]\n" +
"注:默认歌库为网易云热歌榜\n" + "注:默认歌库为网易云热歌榜\n- 本地歌榜歌库歌曲命名规格“歌名 - 歌手”\n" +
"1.可在后面添加“-动漫”进行动漫歌猜歌\n-这个只能猜歌名和歌手\n" + "1.可在后面添加“-动漫”进行动漫歌猜歌\n- 这个只能猜歌名和歌手\n- 本地动漫歌库歌曲命名规格“歌名 - 歌手”\n" +
"2.可在后面添加“-动漫2”进行动漫歌猜歌\n-这个可以猜番名,但歌手经常“未知”", "2.可在后面添加“-动漫2”进行动漫歌猜歌\n- 这个可以猜番名,但歌手经常“未知”\n- 本地动漫2歌库歌曲命名规格“歌名 - 歌手 - 番名”",
PrivateDataFolder: "guessmusic", PrivateDataFolder: "guessmusic",
}).ApplySingle(single.New( }).ApplySingle(single.New(
single.WithKeyFn(func(ctx *zero.Ctx) int64 { return ctx.Event.GroupID }), single.WithKeyFn(func(ctx *zero.Ctx) int64 { return ctx.Event.GroupID }),
@ -489,9 +489,9 @@ func getAnimeData(musicPath string) (musicName string, err error) {
err = errors.New("无法获API取歌曲信息") err = errors.New("无法获API取歌曲信息")
return return
} }
requestURL := "https://autumnfish.cn/search?keywords=" + url.QueryEscape(name+" "+artistName) + "&limit=1" requestURL := "https://music.cyrilstudio.top/search?keywords=" + url.QueryEscape(name+" "+artistName) + "&limit=1"
if artistName == "未知" { if artistName == "未知" {
requestURL = "https://autumnfish.cn/search?keywords=" + url.QueryEscape(acgName+" "+name) + "&limit=1" requestURL = "https://music.cyrilstudio.top/search?keywords=" + url.QueryEscape(acgName+" "+name) + "&limit=1"
} }
data, err = web.GetData(requestURL) data, err = web.GetData(requestURL)
if err != nil { if err != nil {

View File

@ -95,6 +95,7 @@ type autumnfishData struct {
Alias []interface{} `json:"alias"` Alias []interface{} `json:"alias"`
Rtype int `json:"rtype"` Rtype int `json:"rtype"`
Ftype int `json:"ftype"` Ftype int `json:"ftype"`
TransNames []string `json:"transNames"`
Mvid int `json:"mvid"` Mvid int `json:"mvid"`
Fee int `json:"fee"` Fee int `json:"fee"`
RURL interface{} `json:"rUrl"` RURL interface{} `json:"rUrl"`

View File

@ -138,7 +138,7 @@ func kugou(keyword string) message.MessageSegment {
// cloud163 返回网易云音乐卡片 // cloud163 返回网易云音乐卡片
func cloud163(keyword string) (msg message.MessageSegment) { func cloud163(keyword string) (msg message.MessageSegment) {
requestURL := "https://autumnfish.cn/search?keywords=" + url.QueryEscape(keyword) requestURL := "https://music.cyrilstudio.top/search?keywords=" + url.QueryEscape(keyword)
data, err := web.GetData(requestURL) data, err := web.GetData(requestURL)
if err != nil { if err != nil {
msg = message.Text("ERROR:", err) msg = message.Text("ERROR:", err)