diff --git a/go.mod b/go.mod index 41363a1f6d..fb36708e80 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/Baidu-AIP/golang-sdk v1.1.1 - github.com/FloatTech/AnimeAPI v1.7.1-0.20231017135344-aefd1d56e900 + github.com/FloatTech/AnimeAPI v1.7.1-0.20240401063926-a06fe89b1362 github.com/FloatTech/floatbox v0.0.0-20231107124407-e38535efa2a2 github.com/FloatTech/gg v1.1.3-0.20230226151425-6ea91286ba08 github.com/FloatTech/imgfactory v0.2.2-0.20230413152719-e101cc3606ef diff --git a/go.sum b/go.sum index 8e9eed39fd..90e80142fe 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/Baidu-AIP/golang-sdk v1.1.1 h1:RQsAmgDSAkiq22I6n7XJ2t3afgzFeqjY46FGhv github.com/Baidu-AIP/golang-sdk v1.1.1/go.mod h1:bXnGw7xPeKt8aF7UCELKrV6UZ/46spItONK1RQBQj1Y= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/FloatTech/AnimeAPI v1.7.1-0.20231017135344-aefd1d56e900 h1:UPXoj+lMHFBulp/m+F7uHju0MXslFKQqEplDDz/nOiU= -github.com/FloatTech/AnimeAPI v1.7.1-0.20231017135344-aefd1d56e900/go.mod h1:7Olb5U9q1oeayRZQTNBhXQNMf8QT4T9hccsn38IEt/U= +github.com/FloatTech/AnimeAPI v1.7.1-0.20240401063926-a06fe89b1362 h1:llHNgb+UIj8q/2GgR+89pnUNwKQJvKx5EwsetLhJQcE= +github.com/FloatTech/AnimeAPI v1.7.1-0.20240401063926-a06fe89b1362/go.mod h1:7Olb5U9q1oeayRZQTNBhXQNMf8QT4T9hccsn38IEt/U= github.com/FloatTech/floatbox v0.0.0-20231107124407-e38535efa2a2 h1:O4kptIzgYzNwZlBARZFv8EkA40yB6M5LGxxIF7NKLR8= github.com/FloatTech/floatbox v0.0.0-20231107124407-e38535efa2a2/go.mod h1:TeTlp+hTxpJti4JSdmUqzxGEr4wUBOVct9YWBepilpc= github.com/FloatTech/gg v1.1.3-0.20230226151425-6ea91286ba08 h1:dPLeoiTVSBlgls+66EB/UJ2e38BaASmBN5nANaycSBU= diff --git a/plugin/bilibili/bilibili.go b/plugin/bilibili/bilibili.go index 9451dffe1e..74cf92aa93 100644 --- a/plugin/bilibili/bilibili.go +++ b/plugin/bilibili/bilibili.go @@ -337,12 +337,12 @@ func init() { faceH := float64(510) totalDanmuku := 0 - for i := 0; i < len(danmaku.Data.Data); i++ { - totalDanmuku += len(danmaku.Data.Data[i].Danmakus) + 1 + for i := 0; i < len(danmaku.Data.Data.Records); i++ { + totalDanmuku += len(danmaku.Data.Data.Records[i].Danmakus) + 1 } cw := 3000 mcw := float64(2000) - ch := 550 + len(danmaku.Data.Data)*int(faceH) + totalDanmuku*int(danmuH) + ch := 550 + len(danmaku.Data.Data.Records)*int(faceH) + totalDanmuku*int(danmuH) canvas = gg.NewContext(cw, ch) canvas.SetColor(color.White) canvas.Clear() @@ -372,8 +372,8 @@ func init() { canvas.DrawString("网页链接: "+fmt.Sprintf(bz.DanmakuURL, u.Mid), startWidth, 422.5) var channelStart float64 channelStart = float64(550) - for i := 0; i < len(danmaku.Data.Data); i++ { - item := danmaku.Data.Data[i] + for i := 0; i < len(danmaku.Data.Data.Records); i++ { + item := danmaku.Data.Data.Records[i] facePath = cachePath + strconv.Itoa(int(item.Channel.UID)) + "vupFace" + path.Ext(item.Channel.FaceURL) if path.Ext(item.Channel.FaceURL) != ".webp" { err = initFacePic(facePath, item.Channel.FaceURL) @@ -393,7 +393,7 @@ func init() { } canvas.SetRGB255(24, 144, 255) canvas.DrawString("标题: "+item.Live.Title, startWidth, channelStart+fontH) - canvas.DrawString("主播: "+item.Channel.Name, startWidth, channelStart+fontH*2) + canvas.DrawString("主播: "+item.Channel.UName, startWidth, channelStart+fontH*2) canvas.SetColor(color.Black) canvas.DrawString("开始时间: "+time.UnixMilli(item.Live.StartDate).Format("2006-01-02 15:04:05"), startWidth, channelStart+fontH*3) if item.Live.IsFinish { @@ -434,7 +434,7 @@ func init() { canvas.DrawString(t, moveW, danmuNow) moveW += l + dz - t = danItem.Name + t = danItem.UName l, _ = canvas.MeasureString(t) canvas.SetRGB255(24, 144, 255) canvas.DrawString(t, moveW, danmuNow)