Skip to content

Commit

Permalink
docs: 更新文档及代码部分注释
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo2011 committed Jun 29, 2022
1 parent e2c8117 commit 4074417
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 15 deletions.
1 change: 1 addition & 0 deletions bilibili_api/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,7 @@ async def recall_danmaku(self, page_index: int=None, dmid: int=0, cid: int=None)
Args:
page_index: 分 P 号
dmid: 弹幕 id
cid: 分 P 编码
Returns:
调用 API 返回的结果
"""
Expand Down
54 changes: 39 additions & 15 deletions docs/modules/bilibili_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,31 @@ BV 号转 AV 号。

---

## class DmMode

弹幕模式

+ FLY: 飞行弹幕
+ TOP: 顶部弹幕
+ BOTTOM: 底部弹幕
+ REVERSE: 反向弹幕

---

## class DmFontSize

弹幕字体大小

+ EXTREME_SMALL: 最小
+ SUPER_SMALL: 非常小
+ SMALL: 小
+ NORMAL: 中等
+ BIG: 大
+ SUPER_BIG: 非常大
+ EXTREME_BIG: 最大

---

## class Danmaku

弹幕类
Expand All @@ -136,24 +161,23 @@ BV 号转 AV 号。

| name | type | description |
| --------- | ------------------ | ----------------------------------------------------------- |
| text | str | 弹幕文本。 |
| dm_time | float, optional | 弹幕在视频中的位置,单位为秒。Defaults to 0.0. |
| send_time | float, optional | 弹幕发送的时间。Defaults to time.time(). |
| crc32_id | str, optional | 弹幕发送者 UID 经 CRC32 算法取摘要后的值。Defaults to None. |
| color | str, optional | 弹幕十六进制颜色。Defaults to "ffffff". |
| weight | int, optional | 弹幕在弹幕列表显示的权重。Defaults to -1. |
| id_ | int, optional | 弹幕 ID。Defaults to -1. |
| id_str | str, optional | 弹幕字符串 ID。Defaults to "". |
| action | str, optional | 暂不清楚。Defaults to "". |
| mode | Mode, optional | 弹幕模式。Defaults to Mode.FLY. |
| font_size | FontSize, optional | 弹幕字体大小。Defaults to FontSize.NORMAL. |
| is_sub | bool, optional | 是否为字幕弹幕。Defaults to False. |
| pool | int, optional | 暂不清楚。Defaults to -1. |
| attr | int, optional | 暂不清楚。 Defaults to -1. |
| text | str | 弹幕文本。 |
| dm_time | float, optional | 弹幕在视频中的位置,单位为秒。Defaults to 0.0. |
| send_time | float, optional | 弹幕发送的时间。Defaults to time.time(). |
| crc32_id | str, optional | 弹幕发送者 UID 经 CRC32 算法取摘要后的值。Defaults to None. |
| color | str, optional | 弹幕十六进制颜色。Defaults to "ffffff". |
| weight | int, optional | 弹幕在弹幕列表显示的权重。Defaults to -1. |
| id_ | int, optional | 弹幕 ID。Defaults to -1. |
| id_str | str, optional | 弹幕字符串 ID。Defaults to "". |
| action | str, optional | 暂不清楚。Defaults to "". |
| mode | DmMode, optional | 弹幕模式。Defaults to DmMode.FLY. |
| font_size | DmFontSize, optional | 弹幕字体大小。Defaults to DmFontSize.NORMAL. |
| is_sub | bool, optional | 是否为字幕弹幕。Defaults to False. |
| pool | int, optional | 暂不清楚。Defaults to -1. |
| attr | int, optional | 暂不清楚。 Defaults to -1. |

#### def crack_uid()

破解 uid, 依赖 zlib

**Returns:** int: 真实 UID。

17 changes: 17 additions & 0 deletions docs/modules/video.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,23 @@ from bilibili_api import video

**Returns:** API 调用返回结果。

#### _async_ def get_danmaku_snapshot()

获取弹幕快照

**Returns:** API 调用返回结果。

#### _async_ def recall_danmaku()

| name | type | description |
| page_index | int | 分 P 号 |
| dmid | int | 弹幕 id |
| cid | int | 分 P 编码 |

撤回弹幕

**Returns:** API 调用返回结果。

---

## class VideoOnlineMonitor
Expand Down

0 comments on commit 4074417

Please sign in to comment.