mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-18 20:50:12 +08:00
56 lines
1.0 KiB
Go
56 lines
1.0 KiB
Go
package bilibili
|
|
|
|
import (
|
|
"testing"
|
|
|
|
bz "github.com/FloatTech/AnimeAPI/bilibili"
|
|
)
|
|
|
|
func TestArticleInfo(t *testing.T) {
|
|
card, err := bz.GetArticleInfo("17279244")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(articleCard2msg(card, "17279244"))
|
|
|
|
}
|
|
|
|
func TestMemberCard(t *testing.T) {
|
|
card, err := bz.GetMemberCard(2)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Logf("%+v\n", card)
|
|
}
|
|
|
|
func TestVideoInfo(t *testing.T) {
|
|
card, err := bz.GetVideoInfo("10007")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(videoCard2msg(card))
|
|
card, err = bz.GetVideoInfo("BV1xx411c7mD")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(videoCard2msg(card))
|
|
card, err = bz.GetVideoInfo("bv1xx411c7mD")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(videoCard2msg(card))
|
|
card, err = bz.GetVideoInfo("BV1mF411j7iU")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(videoCard2msg(card))
|
|
}
|
|
|
|
func TestLiveRoomInfo(t *testing.T) {
|
|
card, err := bz.GetLiveRoomInfo("83171", "b_ut=7;buvid3=0;i-wanna-go-back=-1;innersign=0;")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(liveCard2msg(card))
|
|
}
|