bilibili-danmaku-client
bilibili-danmaku-client copied to clipboard
A Node.js client for the Bilibili Live Danmaku Interface
去年B站直播弹幕协议有过一次更新,那时候还没影响,但现在貌似开始强制使用了 接收弹幕时会得到 header 中协议版本为`2`的包(协议版本在 header 中偏移量为`6`长度为`2`),其内容是经过 zlib 压缩的多条弹幕的包的组合
``` 00000000: 0000 015a 0010 0000 0000 0005 0000 0000 ...Z............ 00000001: 7b22 636d 6422 3a22 4441 4e4d 555f 4d53 {"cmd":"DANMU_MS 00000002: 473a 343a 303a 323a 323a 323a 3022 2c22...
推荐使用gzip
把握手的protoVer改成2 然后node使用zlib的inflate,浏览器使用pako (或者都使用pako example inflateRaw: https://github.com/simon300000/bilibili-live-ws/blob/master/src/buffer.js#L3 example pako: https://github.com/3Shain/BiliChat/pull/50
Fill the _Events_ Wiki page with event definitions and real-world example data.