update readme

This commit is contained in:
akiba
2023-09-02 22:55:18 +08:00
parent 8c9056ddbf
commit 8996880c20

View File

@@ -33,7 +33,8 @@ import (
func main() { func main() {
log.SetLevel(log.DebugLevel) log.SetLevel(log.DebugLevel)
c := client.NewClient("732", "194484313") // 732为房间号194484313为UID c := client.NewClient("732") // 732为房间号
c.SetCookie("") // 由于 B站 反爬虫改版,现在需要使用已登陆账号的 Cookie 才可以正常获取弹幕。如果不设置 Cookie获取到的弹幕昵称、UID都被限制。还有可能弹幕限流无法获取到全部内容。
//弹幕事件 //弹幕事件
c.OnDanmaku(func(danmaku *message.Danmaku) { c.OnDanmaku(func(danmaku *message.Danmaku) {
if danmaku.Type == message.EmoticonDanmaku { if danmaku.Type == message.EmoticonDanmaku {