Skip to content

Commit

Permalink
docs: 更新/勘误文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo2011 committed Aug 12, 2022
1 parent 66495d8 commit e07e1a5
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 3 deletions.
7 changes: 6 additions & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
+ [搜索](/examples/search.md)
+ [主页](/examples/homepage.md)
+ [排行榜](/examples/rank.md)
+ [分区](/examples/channel.md)
+ [登录](/examples/login.md)
+ [登录函数](/examples/login_func.md)
+ [直播](/examples/live.md)
Expand All @@ -34,6 +35,7 @@
+ [search.py - 搜索](/modules/search.md)
+ [homepage.py - 主页](/modules/homepage.md)
+ [rank.py - 排行榜](/modules/rank.md)
+ [channel.py - 分区](/modules/channel.md)
+ [login.py - 登录](/modules/login.md)
+ [login_func.py - 登录函数](/modules/login_func.md)
+ [live.py - 直播](/modules/live.md)
Expand All @@ -54,9 +56,12 @@
+ API 示例
+ [视频](/ts/examples/video.md)
+ [用户](/ts/examples/user.md)
+ [搜索](/ts/examples/search.md)
+ [分区](/ts/examples/channel.md)
+ API 文档
+ [根模块](/ts/modules/bilibili-api.md)
+ [video.ts - 视频](/ts/modules/video.md)
+ [search.ts - 搜索](/ts/modules/search.md)
+ [user.ts - 用户](/ts/modules/user.md)
+ [search.ts - 搜索](/ts/modules/search.md)
+ [channel.ts - 分区](/ts/modules/channel.md)
+ [历史文档](/history.md)
7 changes: 7 additions & 0 deletions docs/examples/channel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 示例:获取所有的分区

``` python
from bilibili_api import channel

print(channel.get_channel_list())
```
19 changes: 17 additions & 2 deletions docs/modules/channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ from bilibili_api import channel

频道相关操作

## def get_channel_info_by_id()
## def get_channel_info_by_tid()

| name | type | description |
| ---- | ---- | ----------- |
Expand Down Expand Up @@ -40,7 +40,22 @@ from bilibili_api import channel

获取分区前十排行榜。

**Returns:** `tuple[dict | None, dict | None]`: 第一个是主分区,第二个是子分区,没有时返回 None。
**Returns:** `dict`: 调用 API 返回的结果

---

## async get_channel_list()

获取所有分区的数据

**Returns:** dict: 所有分区的数据

---

## async get_channel_list_sub()

获取所有分区的数据

含父子关系(即一层次只有主分区)

**Returns:** dict: 所有分区的数据
7 changes: 7 additions & 0 deletions docs/ts/examples/channel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 示例:查询分区 tid

``` javascript
const channel = require("bilibili-api-ts/channel");

console.log(channel.get_channel_info_by_name({name: "动物圈"})[0].tid)
```
6 changes: 6 additions & 0 deletions docs/ts/examples/search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 示例:获取搜索结果

``` typescript
const search = requier("bilibili-api-ts/search");
search.search({keyword: "奥利给"}).then(value => console.log(value));
```
46 changes: 46 additions & 0 deletions docs/ts/modules/channel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Module channel.ts(channel.js)

```typescript
import {} from "bilibili-api-ts/channel";
```

频道相关操作

## def get_channel_info_by_tid()

| name | type | description |
| ---- | ---- | ----------- |
| tid | int | 频道的 tid |

根据 tid 获取频道信息。

**Returns:** `Object[Object, Object]`: 第一个是主分区,第二个是子分区,没有时返回 None。

---

## def get_channel_info_by_name()

| name | type | description |
| ---- | ---- | ------------ |
| name | str | 频道的名称。 |

根据频道名称获取频道信息。

**Returns:** `Object[Object, Object]`: 第一个是主分区,第二个是子分区,没有时返回 None。

---

## async def get_top10()

| name | type | description |
| ---------- | -------------------- | -------------------------------------- |
| tid | int | 频道的 tid |
| day | int, optional | 3 天排行还是 7 天排行。 Defaults to 7. |
| credential | Credential, optional | Credential 类。Defaults to None. |

获取分区前十排行榜。

**Returns:** `Object`: 调用 API 返回的结果

---

4 changes: 4 additions & 0 deletions docs/ts/modules/search.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Module search.ts(search.js)

``` typescript
import {} from "bilibili-api-ts/search"
```

## enum SearchObjectType

搜索对象枚举。
Expand Down
18 changes: 18 additions & 0 deletions docs/ts/modules/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,21 @@ import {} from "bilibili-api-ts/user"
获取用户信息(昵称,性别,生日,签名,头像URL,空间横幅URL等)

**Returns:** 调用接口返回的内容。

#### async function get_relation_info()

获取用户关系信息(关注数,粉丝数,悄悄关注,黑名单数)

**Returns:** 调用接口返回的内容。

#### async function get_up_stat()

获取 UP 主数据信息(视频总播放量,文章总阅读量,总点赞数)

**Returns:** 调用接口返回的内容。

#### async function get_live_info()

获取用户直播间信息。

**Returns:** 调用接口返回的内容。

0 comments on commit e07e1a5

Please sign in to comment.