This commit is contained in:
akiba
2023-09-03 13:22:02 +08:00
parent 597efb45b7
commit 50502af7c0
2 changed files with 2 additions and 2 deletions

View File

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

View File

@@ -13,7 +13,7 @@ import (
func main() { func main() {
log.SetLevel(log.DebugLevel) log.SetLevel(log.DebugLevel)
c := client.NewClient("6") c := client.NewClient(6)
c.SetCookie("this is a example cookie.") c.SetCookie("this is a example cookie.")
//弹幕事件 //弹幕事件
c.OnDanmaku(func(danmaku *message.Danmaku) { c.OnDanmaku(func(danmaku *message.Danmaku) {