From e89db0afcdc7bcbbd619c06b04d9da6112ef84f7 Mon Sep 17 00:00:00 2001 From: poorguy Date: Fri, 5 Feb 2021 21:45:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8D=87README.md=E5=8F=AF=E8=AF=BB?= =?UTF-8?q?=E6=80=A7=20(#14)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 提升README.md可读性 * Update README.md * update variable name * update variable name --- README.md | 7 ++++++- sample.py | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ba6d60e..df4a56e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,12 @@ # blivedm -获取bilibili直播弹幕,使用websocket协议 +python3获取bilibili直播弹幕,使用websocket协议 [协议解释](https://blog.csdn.net/xfgryujk/article/details/80306776)(有点过时了,总体是没错的) 基于本库开发的一个应用:[blivechat](https://github.com/xfgryujk/blivechat) + + +## 使用说明 +1. 使用`pip install -r requirements.txt`命令安装依赖,具体有目录下[sample.py](./sample.py)和[blivedm.py](./blivedm.py)用到的相关python依赖 +2. 将[sample.py](./sample.py)文件中的room_id替换为直播间ID diff --git a/sample.py b/sample.py index 9de94c1..acf262c 100644 --- a/sample.py +++ b/sample.py @@ -32,7 +32,8 @@ class MyBLiveClient(blivedm.BLiveClient): async def main(): # 参数1是直播间ID # 如果SSL验证失败就把ssl设为False - client = MyBLiveClient(14917277, ssl=True) + room_id = 14917277 + client = MyBLiveClient(room_id, ssl=True) future = client.start() try: # 5秒后停止,测试用