mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 05:30:07 +08:00
* 🎨 修改bilibili,bilibiliparse插件结构,添加bilibili动态直播专栏解析 * 💩 修改大小写 * 🎨 正则全局,错误处理 * 🎨 使用json.NewDecoder() * 💚 空使用 * 💚 修lint
83 lines
1.5 KiB
Go
83 lines
1.5 KiB
Go
package bilibili
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestArticleInfo(t *testing.T) {
|
|
card, err := getArticleInfo("17279244")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(articleCard2msg(card, "17279244"))
|
|
|
|
}
|
|
|
|
func TestDynamicDetail(t *testing.T) {
|
|
t.Log("cType = 1")
|
|
t.Log(dynamicDetail("642279068898689029"))
|
|
|
|
t.Log("cType = 2")
|
|
t.Log(dynamicDetail("642470680290394121"))
|
|
|
|
t.Log("cType = 2048")
|
|
t.Log(dynamicDetail("642277677329285174"))
|
|
|
|
t.Log("cType = 4")
|
|
t.Log(dynamicDetail("642154347357011968"))
|
|
|
|
t.Log("cType = 8")
|
|
t.Log(dynamicDetail("675892999274627104"))
|
|
|
|
t.Log("cType = 4308")
|
|
t.Log(dynamicDetail("668598718656675844"))
|
|
|
|
t.Log("cType = 64")
|
|
t.Log(dynamicDetail("675966082178088963"))
|
|
|
|
t.Log("cType = 256")
|
|
t.Log(dynamicDetail("599253048535707632"))
|
|
|
|
t.Log("cType = 4,投票类型")
|
|
t.Log(dynamicDetail("677231070435868704"))
|
|
}
|
|
|
|
func TestMemberCard(t *testing.T) {
|
|
card, err := getMemberCard(2)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Logf("%+v\n", card)
|
|
}
|
|
|
|
func TestVideoInfo(t *testing.T) {
|
|
card, err := getVideoInfo("10007")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(videoCard2msg(card))
|
|
card, err = getVideoInfo("BV1xx411c7mD")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(videoCard2msg(card))
|
|
card, err = getVideoInfo("bv1xx411c7mD")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(videoCard2msg(card))
|
|
card, err = getVideoInfo("BV1mF411j7iU")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(videoCard2msg(card))
|
|
}
|
|
|
|
func TestLiveRoomInfo(t *testing.T) {
|
|
card, err := getLiveRoomInfo("83171")
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(liveCard2msg(card))
|
|
}
|