-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
# douyudanmu | ||
实时获取斗鱼弹幕 | ||
|
||
## 安装 | ||
``` | ||
npm i -g douyudm | ||
``` | ||
|
||
## 使用 | ||
``` | ||
douyudm -i 房间号 | ||
``` | ||
更多命令查看 `douyudm --help` | ||
|
||
## 提醒 | ||
- 使用yarn全局安装可能会无法使用 | ||
|
||
## 后话 | ||
坑太多了,github上的库大部分都是不能使用的,如果近期更新的可以判断使用的新接口,review了几乎所有相关的库,都是依据斗鱼自己官方平台的方法发起tcp连接?但根本连不上,一直拒绝... | ||
|
||
看了下能使用的库,都是通过websocket建立的连接,立马修改,不出片刻撸完,发现发送数据的格式有点难搞,虽说示意图挺清楚的,但是用Buffer传输死活没有相应的消息,调试太磨人心性了,玛德,直接去把斗鱼网页上的方法扒下来。 | ||
|
||
通过webpack打包混淆代码乍一眼看去很混乱,其实仔细观察还是有规律寻找的。 | ||
|
||
文档中编码的几个固定参数均为数字,在webpack中数字的混淆我还没见过,按这个思路精准的找到这段代码。经过我十几分钟的理解,提取出 [**bufferCoder.js**](src/bufferCoder.js) | ||
|
||
斗鱼自有的序列化,反序列化方法可以查看 [**stt.js**](src/stt.js) |