🚀调整项目结构

This commit is contained in:
SocialSisterYi
2023-02-22 01:00:06 +08:00
parent b85e835ce7
commit 7d89ece2ac
201 changed files with 84964 additions and 0 deletions

79
docs/manga/Activity.md Normal file
View File

@@ -0,0 +1,79 @@
# 漫画任务操作
- [漫画任务操作](#漫画任务操作)
- [分享漫画](#分享漫画)
## 分享漫画
> https://manga.bilibili.com/twirp/activity.v1.Activity/ShareComic
_请求方式POST_
认证方式CookieSESSDATA/ APP
**正文参数( application/x-www-form-urlencoded **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| -------- | ---- | ---- | ------ | ------- |
| platform | str | 平台 | 必要 | android |
**json 回复:**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | --------- | -------- | ------------------------------------------------------- |
| code | num / str | 返回值 | 见对应表格 |
| msg | str | 错误信息 | |
| meta | obj | 错误信息 | invalid_argument 时存在,例如 `{"argument":"platform"}` |
| data | obj | | `code` 为 0`msg` 为空时存在 |
`code` - `msg` 对应表:
| code | code 类型 | msg | 备注 |
| ---------------- | --------- | ------------------ | --------------------------- |
| 0 | num | 空 | 分享成功,`data` 存在 |
| 0 | num | 今日已分享 | |
| invalid_argument | str | xxxx must be valid | xxxx 字段为必须,`meta`存在 |
| unauthenticated | str | must login | 必须登录才能分享 |
`data` 对象:
| 字段 | 类型 | 内容 | 备注 |
| ----- | ---- | -------- | ---- |
| point | num | 获取积分 | |
**示例:**
```bash
curl -X POST https://manga.bilibili.com/twirp/activity.v1.Activity/ShareComic \
-b "SESSDATA=xxxxx" \
--data-urlencode 'platform=android'
```
<details>
<summary>分享成功:</summary>
```json
{
"code": 0,
"msg": "",
"data": {
"point": 5
}
}
```
</details>
<details>
<summary>今日已分享:</summary>
```json
{
"code": 0,
"msg": "今日已分享"
}
```
</details>

217
docs/manga/ClockIn.md Normal file
View File

@@ -0,0 +1,217 @@
# 签到
> https://manga.bilibili.com/twirp/activity.v1.Activity/ClockIn
*请求方式POST*
认证方式CookieSESSDATA/ APP
**正文参数( application/x-www-form-urlencoded **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|----------|-----|----|-----|---------|
| platform | str | 平台 | 必要 | android |
| device | str | 平台 | 非必要 | h5 |
**正文参数( application/json **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|------|-----|------|-----|-------|
| type | num | | 非必要 | 补签时使用 |
| date | str | 补签日期 | 必要 | 补签时使用 |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
|------|-----------|------|--------------------------------------------|
| code | num / str | 返回值 | 0成功<br />invalid_argument今日已签到 |
| msg | str | 错误信息 | 成功:空<br />已签到clockin clockin is duplicate |
| meta | obj | 错误信息 | 今日已签到时存在 |
| data | obj | | |
**示例:**
普通签到:
```bash
curl -L -X POST 'https://manga.bilibili.com/twirp/activity.v1.Activity/ClockIn' \
-H 'Cookie: SESSDATA=xxx' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'platform=android'
```
<details>
<summary>签到成功:</summary>
```json
{
"code": 0,
"msg": "",
"data": {}
}
```
</details>
<details>
<summary>今日已签到:</summary>
```json
{
"code": "invalid_argument",
"msg": "clockin clockin is duplicate",
"meta": {
"argument": "clockin"
}
}
```
</details>
补签:
```bash
curl -L 'https://manga.bilibili.com/twirp/activity.v1.Activity/ClockIn?platform=android' \
-H 'Cookie: SESSDATA=xxx' \
-H 'content-type: application/json;charset=UTF-8' \
-d '{"type":0,"date":"2023-02-15"}'
```
<details>
<summary>补签成功:</summary>
```json
{
"code": 0,
"msg": "",
"data": {}
}
```
</details>
# 查询签到状态
> https://manga.bilibili.com/twirp/activity.v1.Activity/GetClockInInfo
*请求方式POST*
认证方式CookieSESSDATA/ APP
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
|------|-----|------|------|
| code | num | 返回值 | 0成功 |
| msg | str | 错误信息 | 空 |
| data | obj | 信息本体 | |
`data` 对象:
| 字段 | 类型 | 内容 | 备注 |
|-------------------|-------|------------------|------------------|
| day_count | num | 连续签到天数 | |
| status | num | 今日是否已签到 | 0未签到<br />1已签到 |
| credit_icon | str | | |
| sign_before_icon | str | | |
| sign_today_icon | str | | |
| breathe_icon | str | | |
| new_credit_x_icon | str | | |
| coupon_pic | str | | |
| points | array | 一次签到周期中每次签到可获得点数 | |
| point_infos | array | | |
`point_infos`数组中的对象:
| 字段 | 类型 | 内容 | 备注 |
|--------------|------|---------|----|
| point | num | 签到可获取积分 | |
| origin_point | num | | |
| is_activity | bool | | |
| title | str | 签到奖励描述 | |
**示例:**
```bash
curl -L -X POST 'https://manga.bilibili.com/twirp/activity.v1.Activity/GetClockInInfo' \
-H 'Cookie: SESSDATA=xxx'
```
<details>
<summary>成功:</summary>
```json
{
"code": 0,
"msg": "",
"data": {
"day_count": 58,
"status": 1,
"points": [
10,
20,
20,
10,
10,
10,
30
],
"credit_icon": "https://i0.hdslb.com/bfs/static/manga/artifact/sign-resource/v2/9da6QImiK_w192_h192.png",
"sign_before_icon": "https://i0.hdslb.com/bfs/static/manga/artifact/sign-resource/v2/BuA6z3lhN_w192_h192.png",
"sign_today_icon": "https://i0.hdslb.com/bfs/static/manga/artifact/sign-resource/v2/TWSLUHbbg_w192_h192.png",
"breathe_icon": "http://i0.hdslb.com/bfs/static/manga/artifact/sign-resource/anime.breathe.svga",
"point_infos": [
{
"point": 10,
"origin_point": 10,
"is_activity": false,
"title": "10积分"
},
{
"point": 20,
"origin_point": 20,
"is_activity": false,
"title": "20积分"
},
{
"point": 20,
"origin_point": 20,
"is_activity": false,
"title": "20积分"
},
{
"point": 10,
"origin_point": 10,
"is_activity": false,
"title": "10积分"
},
{
"point": 10,
"origin_point": 10,
"is_activity": false,
"title": "10积分"
},
{
"point": 10,
"origin_point": 10,
"is_activity": false,
"title": "10积分"
},
{
"point": 30,
"origin_point": 30,
"is_activity": false,
"title": "30积分+福利券"
}
],
"new_credit_x_icon": "https://i0.hdslb.com/bfs/static/manga/artifact/sign-resource/v2/QP5DsW2S_w192_h192.png",
"coupon_pic": "https://i0.hdslb.com/bfs/static/manga/artifact/sign-resource/v2/Yalqqoiz_w402_h162.png"
}
}
```
</details>

4223
docs/manga/Comic.md Normal file

File diff suppressed because it is too large Load Diff

256
docs/manga/Download.md Normal file
View File

@@ -0,0 +1,256 @@
# 获取当前话全部图片地址
> https://manga.bilibili.com/twirp/comic.v1.Comic/GetImageIndex
*请求方式POST*
认证方式CookieSESSDATA/ APP
**URL参数**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ---------- | ---- | ------------------------ | -------------- | ------------------------------------------------------------ |
| access_key | str | APP登录凭证 | 必要 | 使用APP鉴权方式时必填 |
| appkey | str | cc8617fd6961e070 | 非必要 | |
| mobi_app | str | android_comic | 非必要 | |
| version | str | 4.21.0 | 非必要 | |
| build | str | 36421000 | 非必要 | |
| channel | str | bilicomic | 非必要 | |
| platform | str | android | 非必要 | |
| device | str | android | 非必要 | |
| buvid | str | XY118701XXXXXXXXX104911DXXXXXCAEXXXXE | 非必要 | 长度为37 |
| machine | str | | 非必要 | 手机品牌+型号 |
| is_teenager | num | 0 | 非必要 | |
| no_recommend | num | 0 | 非必要 | |
| ts | num | 秒级时间戳 | 非必要 |
**正文参数( application/json **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| -------- | ---- | ------------------------ | ------ | ------------------------------------------------- |
| epIdep_id | num | 当前话的id | 必要 | |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | 0成功 |
| msg | str | 错误信息 | |
| data | obj | | |
`data` 对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| path | str | .index 文件路径 | 解密详见[此处](./unlock_index_data.md) |
| images | array | 本话图片信息 | |
| last_modified | str | 本话信息最后修改时间 | |
| host | str | `https://manga.hdslb.com` | |
| video | obj | | |
`images` 数组中的对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| path | str | 图片的路径 | 不包含host |
| x | num | 图片宽度 | 单位像素px |
| y | num | 图片高度 | 单位像素px |
| video_path | str | | |
| video_size | str | | |
`video` 对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| svid | str | | |
| filename | str | | |
| route | str | | |
| resource | array | | |
| raw_width | str | | |
| raw_height | str | | |
| raw_rotate | str | | |
| img_urls | array | | |
| bin_url | str | | |
| img_x_len | num | | |
| img_x_size | num | | |
| img_y_len | num | | |
| img_y_size | num | | |
**示例:**
```bash
curl -L -X POST 'https://manga.bilibili.com/twirp/comic.v1.Comic/GetImageIndex' \
-H 'Cookie: SESSDATA=xxx;' \
-H 'Content-Type: application/json' \
--data-raw '{
"ep_id": 321912
}'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": {
"path": "/bfs/manga/26564/321912/data.index?token=80eab62fef85c1c134a6399f817a938f&ts=63404145",
"images": [
{
"path": "/bfs/manga/11e404e602fa9f709bfb89d692ac56d2e17f974d.jpg",
"x": 1600,
"y": 2268,
"video_path": "",
"video_size": "0"
},
{
"path": "/bfs/manga/bf1c48540b68f473b429317d8f6fa8cdb6eed3a5.jpg",
"x": 1600,
"y": 2268,
"video_path": "",
"video_size": "0"
},
{
"path": "/bfs/manga/a46cfe90cfb49c67a4dbfc0002e5bc3d87d02963.jpg",
"x": 1600,
"y": 2268,
"video_path": "",
"video_size": "0"
}
],
"last_modified": "2019-05-13 21:15:53",
"host": "https://manga.hdslb.com",
"video": {
"svid": "",
"filename": "",
"route": "",
"resource": [],
"raw_width": "0",
"raw_height": "0",
"raw_rotate": "0",
"img_urls": [],
"bin_url": "",
"img_x_len": 10,
"img_x_size": 160,
"img_y_len": 10,
"img_y_size": 90
}
}
}
```
</details>
# 获取某一图片的token
> https://manga.bilibili.com/twirp/comic.v1.Comic/ImageToken
*请求方式POST*
认证方式CookieSESSDATA/ APP
**URL参数**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ------------ | ---- | ------------------------------------- | ------ | --------------------- |
| access_key | str | APP登录凭证 | 必要 | 使用APP鉴权方式时必填 |
| appkey | str | cc8617fd6961e070 | 非必要 | |
| mobi_app | str | android_comic | 非必要 | |
| version | str | 4.21.0 | 非必要 | |
| build | str | 36421000 | 非必要 | |
| channel | str | bilicomic | 非必要 | |
| platform | str | android | 非必要 | |
| device | str | android | 非必要 | |
| buvid | str | XY118701XXXXXXXXX104911DXXXXXCAEXXXXE | 非必要 | 长度为37 |
| machine | str | samsung+SM-G9730 | 非必要 | 手机品牌+型号 |
| is_teenager | num | 0 | 非必要 | |
| no_recommend | num | 0 | 非必要 | |
| ts | num | 秒级时间戳 | 非必要 | |
**正文参数( application/json **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ------ | ---- | ------------------- | ------ | ------------------------------------------------------------ |
| urls | str | 请求token的图片地址 | 必要 | `[\"https://i0.hdslb.com{path}\"]` <br />{path}代表图片的相对网站路径支持jpg和webp |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | ----- | -------- | ------- |
| code | num | 返回值 | 0成功 |
| msg | str | 错误信息 | |
| data | array | | |
`data` 数组中的对象:
| 字段 | 类型 | 内容 | 备注 |
| ----- | ---- | ------------------- | ------------------------------------ |
| url | str | 图片下载的地址 | 此时网址开头 https://manga.hdslb.com |
| token | str | 图片下载需要的token | |
**示例:**
```bash
curl -L -X POST 'https://manga.bilibili.com/twirp/comic.v1.Comic/ImageToken' \
-H 'Cookie: SESSDATA=xxx;' \
-H 'Content-Type: application/json' \
--data-raw '{
"urls": "[\"https://i0.hdslb.com/bfs/manga/11e404e602fa9f709bfb89d692ac56d2e17f974d.jpg\"]"
}'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": [
{
"url": "https://manga.hdslb.com/bfs/manga/11e404e602fa9f709bfb89d692ac56d2e17f974d.jpg",
"token": "36931815abb35857627a22c347dc1c86&ts=634045c2"
}
]
}
```
</details>
# 下载图片
*请求方式GET*
在上一步获取token的基础上构建如下的url
例如获取到此token
```
{
"code": 0,
"msg": "",
"data": [
{
"url": "https://manga.hdslb.com/bfs/manga/11e404e602fa9f709bfb89d692ac56d2e17f974d.jpg",
"token": "36931815abb35857627a22c347dc1c86&ts=634045c2"
}
]
}
```
则访问以下网址即可,注意需要添加`?token=`。此网址有效期较短
```
https://manga.hdslb.com/bfs/manga/11e404e602fa9f709bfb89d692ac56d2e17f974d.jpg?token=36931815abb35857627a22c347dc1c86&ts=634045c2
```
备注:若访问 `https://i0或i1.hdslb.com/bfs/manga或new_dyn或archive/11e404e602fa9f709bfb89d692ac56d2e17f974d.jpg` 均无法获取

439
docs/manga/Season.md Normal file
View File

@@ -0,0 +1,439 @@
# 漫画赛季
- [漫画赛季](#漫画赛季)
- [获取赛季信息](#获取赛季信息)
- [赛季奖励领取](#赛季奖励领取)
_漫画赛季仅在 app 端可见,但可以使用 Cookie 鉴权_
## 获取赛季信息
> https://manga.bilibili.com/twirp/user.v1.Season/GetSeasonInfo
_请求方式POST_
接口不鉴权可查看基本信息,鉴权后可查看赛季个人信息和赛季规则。
认证方式CookieSESSDATA/ APP
**json 回复:**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- | -------- | ---- |
| code | num | 返回值 | |
| msg | str | 错误信息 | |
| data | obj | 信息本体 | |
`data` 对象:
| 字段 | 类型 | 内容 | 备注 |
| ------------------ | ----- | ------------------ | -------------------------- |
| current_time | str | 当前时间字符串 | ISO 8601 |
| start_time | str | 赛季开始 | ISO 8601 |
| end_time | str | 赛季结束 | ISO 8601 |
| remain_amount | num | 拥有积分 | 未登录为 `0` |
| season_id | str | 第几个赛季 | |
| tasks | array | 待领取奖励的任务 | 未登录/没有可领取时为 `[]` |
| welfare | array | 赛季奖励 | |
| next | obj | 未知 | 未登录为 `null` |
| cover | str | 版头图片 | |
| today_tasks | array | 今日的任务完成情况 | |
| text | obj | 赛季相关文案 | 未登录为 `null` |
| season_clock_in | obj | | |
| announcement | obj | 未知 | 未登录为 `null` |
| lottery | obj | | |
| mission_point_rate | str | | |
| season_title | str | 赛季标题 | |
| point_rate | obj | | |
| rank | obj | | |
`data` 对象的 `rank`
| 字段 | 类型 | 内容 | 备注 |
| ---------- | ---- | ----- | ---- |
| is_visible | bool | false | |
`data` 对象的 `tasks`
| 字段 | 类型 | 内容 | 备注 |
| ------ | ---- | ---------- | ----------------------- |
| title | str | 任务描述 | |
| id | str | | |
| status | num | 任务状态 | 应该都是`1`:待领取奖励 |
| type | num | | 与 today_tasks 的一致 |
| amount | num | 可获取积分 | |
| ctime | str | 完成时间 | ISO 8601 |
`data` 对象的 `next`
| 字段 | 类型 | 内容 | 备注 |
| ------------ | ---- | ---- | ---- |
| title | str | 空 | |
| amount | num | 0 | |
| gap_time | num | 0 | |
| current_time | num | 0 | |
`data` 对象的 `text`
| 字段 | 类型 | 内容 | 备注 |
| ------------ | ---- | ------------ | ---- |
| notice | str | 赛季公告 | |
| clonckInRule | str | 赛季签到规则 | |
`data` 对象的 `announcement`
| 字段 | 类型 | 内容 | 备注 |
| -------- | ---- | ----- | ---- |
| title | str | 空 | |
| jump_url | str | 空 | |
| enable | bool | false | |
`data` 对象的 `point_rate`
| 字段 | 类型 | 内容 | 备注 |
| ------------- | ---- | ---- | ---- |
| sign_in | num | 0 | |
| game | num | 0 | |
| daily_mission | num | 0 | |
| week_mission | num | 0 | |
`data` 对象的 `lottery`
| 字段 | 类型 | 内容 | 备注 |
| ---------------------- | ---- | ------------ | ---- |
| lottery_act_id | str | '0' | |
| enable_lottery | bool | 是否开启抽奖 | |
| lottery_id | str | '0' | |
| advance_lottery_act_id | str | '0' | |
| advance_pool_id | str | '0' | |
`data` 对象的 `season_clock_in`
| 字段 | 类型 | 内容 | 备注 |
| ----------------- | ---- | ---------------- | ---- |
| is_super_luck | bool | | |
| draw_luck_time | str | | |
| prize_type | num | | |
| prize_title | str | | |
| add_up_sign | num | 赛季连续签到天数 | |
| title | str | 签到标题 | |
| sign_old_amount | num | | |
| preluck_amount | num | | |
| continuous_days | num | 连续签到天数 | |
| address_id | str | | |
| has_super_prize | bool | | |
| subtitle | str | 签到子标题 | |
| prize_image | str | | |
| prize_target_days | num | | |
| prize_amount | num | | |
| tomorrow_amount | num | 明日签到积分 | |
| entrance_tag | str | | |
`data` 对象的 `today_tasks`
| 字段 | 类型 | 内容 | 备注 |
| ---------- | ---------- | ------------ | ------------------------------------------- |
| type | num | | |
| title | str | 任务标题 | 可能为空字符串 |
| amount | num | 可获得积分 | |
| status | num | 完成状态 | 0未完成<br />1待领取奖励<br />2已完成 |
| duration | num | 耗时(分) | 直接完成的为 0 |
| comics | comic 数组 | 任务指定漫画 | 仅`type=22`时有内容,所有账号是一致的 |
| page_url | str | 空 | |
| progress | num | 已完成进度 | |
| sub_id | num | | `type` 一致时有效 |
| share_type | num | `0` | |
`today_tasks`对象的 `comics`
| 字段 | 类型 | 内容 | 备注 |
| -------------- | -------- | -------- | ---- |
| comic_id | num | 漫画 id | |
| title | str | 漫画名称 | |
| vertical_cover | str | 漫画封面 | |
| styles | str 数组 | 漫画类型 | |
`data` 对象的 `welfare`
| 字段 | 类型 | 内容 | 备注 |
| --------------- | ---- | ------------ | --------------------------------------------------------- |
| type | num | 奖励类型 | 200-限免卡<br/>202-漫读券<br/>203-优惠券<br/>205-最终宝箱 |
| success | num | 兑换状态 | 0-未兑换<br/>2-已兑换 |
| exchange_amount | num | 积分消耗 | |
| boss_welfare | bool | 最终奖励 | |
| boss_remain | num | 最终奖励剩余 | |
| rank | num | 顺序 | |
| title | str | 空 | |
| url | str | 空 | |
| kind_address_id | str | '0' | |
**示例:**
```bash
curl -X POST https://manga.bilibili.com/twirp/user.v1.Season/GetSeasonInfo
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": {
"current_time": "2022-11-30T15:12:00+08:00",
"start_time": "2022-11-14T00:00:00+08:00",
"end_time": "2022-12-11T23:59:00+08:00",
"remain_amount": 0,
"season_id": "35",
"tasks": [],
"welfare": [
{
"type": 200,
"success": 0,
"exchange_amount": 100,
"boss_welfare": false,
"boss_remain": 0,
"rank": 1,
"title": "",
"url": "",
"kind_address_id": "0"
},
// 中间的省略
{
"type": 205,
"success": 0,
"exchange_amount": 0,
"boss_welfare": true,
"boss_remain": 0,
"rank": 21,
"title": "",
"url": "",
"kind_address_id": "0"
}
],
"next": null,
"cover": "https://i0.hdslb.com/bfs/manga-static/b81fcd291cff74965b71d67e7df261de5790c2cd.png",
"today_tasks": [
{
"type": 18,
"title": "",
"amount": 20,
"status": 0,
"duration": 30,
"comics": [],
"page_url": "",
"progress": 0,
"sub_id": 1,
"share_type": 0
},
{
"type": 20,
"title": "",
"amount": 20,
"status": 0,
"duration": 3,
"comics": [],
"page_url": "",
"progress": 0,
"sub_id": 1,
"share_type": 0
},
{
"type": 22,
"title": "",
"amount": 50,
"status": 0,
"duration": 15,
"comics": [
{
"comic_id": 32190,
"title": "我的成就有点多",
"vertical_cover": "https://i0.hdslb.com/bfs/manga-static/efc403e323656fad24335aef007af5f318879597.png",
"styles": ["都市"]
},
{
"comic_id": 30538,
"title": "我知道你的秘密",
"vertical_cover": "https://i0.hdslb.com/bfs/manga-static/607f2c13afcf82ebba98f18213033d93bba7d58a.jpg",
"styles": ["悬疑"]
},
{
"comic_id": 25874,
"title": "桃花宝典",
"vertical_cover": "http://i0.hdslb.com/bfs/manga-static/bb1d33004af7dfbf197572cb9ef1c5fdd19e17a8.jpg",
"styles": ["都市"]
}
],
"page_url": "",
"progress": 0,
"sub_id": 1,
"share_type": 0
},
{
"type": 17,
"title": "阅读3分钟",
"amount": 10,
"status": 0,
"duration": 3,
"comics": [],
"page_url": "",
"progress": 0,
"sub_id": 1,
"share_type": 0
},
{
"type": 17,
"title": "阅读5分钟",
"amount": 10,
"status": 0,
"duration": 5,
"comics": [],
"page_url": "",
"progress": 0,
"sub_id": 2,
"share_type": 0
},
{
"type": 17,
"title": "阅读10分钟",
"amount": 20,
"status": 0,
"duration": 10,
"comics": [],
"page_url": "",
"progress": 0,
"sub_id": 3,
"share_type": 0
},
{
"type": 17,
"title": "阅读20分钟",
"amount": 40,
"status": 0,
"duration": 20,
"comics": [],
"page_url": "",
"progress": 0,
"sub_id": 4,
"share_type": 0
},
{
"type": 17,
"title": "阅读30分钟",
"amount": 60,
"status": 0,
"duration": 30,
"comics": [],
"page_url": "",
"progress": 0,
"sub_id": 5,
"share_type": 0
},
{
"type": 19,
"title": "每日首次玩猜拳",
"amount": 5,
"status": 0,
"duration": 1,
"comics": [],
"page_url": "",
"progress": 0,
"sub_id": 1,
"share_type": 0
},
{
"type": 1,
"title": "打开系统通知",
"amount": 5,
"status": 0,
"duration": 0,
"comics": [],
"page_url": "",
"progress": 0,
"sub_id": 0,
"share_type": 0
},
{
"type": 2,
"title": "设置个人偏好",
"amount": 5,
"status": 0,
"duration": 0,
"comics": [],
"page_url": "",
"progress": 0,
"sub_id": 0,
"share_type": 0
}
],
"text": null,
"season_clock_in": {
"is_super_luck": false,
"draw_luck_time": "",
"prize_type": 0,
"prize_title": "",
"add_up_sign": 0,
"title": "",
"sign_old_amount": 0,
"preluck_amount": 0,
"continuous_days": 0,
"address_id": "0",
"has_super_prize": false,
"subtitle": "",
"prize_image": "",
"prize_target_days": 0,
"prize_amount": 0,
"tomorrow_amount": 0,
"entrance_tag": ""
},
"announcement": null,
"lottery": {
"lottery_act_id": "0",
"enable_lottery": true,
"lottery_id": "0",
"advance_lottery_act_id": "0",
"advance_pool_id": "0"
},
"mission_point_rate": 0,
"season_title": "初冬赛季",
"point_rate": { "sign_in": 0, "game": 0, "daily_mission": 0, "week_mission": 0 },
"rank": { "is_visible": false }
}
}
```
</details>
## 赛季奖励领取
> https://manga.bilibili.com/twirp/user.v1.Season/TakeSeasonGifts
_请求方式POST_
认证方式CookieSESSDATA/ APP
**正文参数( application/x-www-form-urlencoded **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| --------- | ---- | ------- | ------ | --------------- |
| season_id | num | 赛季 id | 必要 | 必须为本赛季 id |
**json 回复:**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- | -------- | ---- |
| code | num | 返回值 | |
| msg | str | 错误信息 | |
`code` - `msg` 对照表:
| code | msg | 备注 |
| ---- | ------------------------------------ | ---------------------------- |
| 0 | | 领取成功 |
| 2 | 当前没有正在进行的赛季,无法兑换奖励 | season_id 字段不正确 |
| 7 | 任务已领取或者未完成 | 没有已经完成的 `today_tasks` |

730
docs/manga/User.md Normal file
View File

@@ -0,0 +1,730 @@
# 获取拥有的漫读券列表
> https://manga.bilibili.com/twirp/user.v1.User/GetCoupons
*请求方式POST*
认证方式CookieSESSDATA/ APP
**URL参数**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ---------- | ---- | ------------------------ | -------------- | ------------------------------------------------------------ |
| access_key | str | APP登录凭证 | 必要 | 使用APP鉴权方式时必填 |
| appkey | str | cc8617fd6961e070 | 非必要 | |
| mobi_app | str | android_comic | 非必要 | |
| version | str | 4.13.0 | 非必要 | |
| build | str | 36413002 | 非必要 | |
| channel | str | bilicomic | 非必要 | |
| platform | str | android | 非必要 | |
| device | str | android | 非必要 | |
| buvid | str | | 非必要 | |
| machine | str | samsung+SM-G9730 | 非必要 | |
| is_teenager | num | 0 | 非必要 | |
| no_recommend | num | 0 | 非必要 | |
| ts | num | 秒级时间戳 | 非必要 | |
**正文参数( application/json **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| -------- | ---- | ------------------------ | ------ | ------------------------------------------------- |
| pageNum | num | 页数 | 必要 | |
| pageSize | num | 分页大小 | 必要 | 默认20取值范围[1,100] |
| notExpired | bool | true | 非必要 | |
| tabType | num | 1 | 非必要 | |
| type | num | 0 | 非必要 | |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | 0成功 |
| msg | str | 错误信息 | |
| data | obj | | |
`data` 对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| total_remain_amount | num | | |
| user_coupons | array | | |
| coupon_info | obj | | |
`user_coupons` 数组中的对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| ID | num | 漫读券id | |
| remain_amount | num | 漫读券剩余数 | |
| expire_time | num | 过期时间 | |
| reason | num | 获取方式 | |
| type | num | 类型 | |
| ctime | num | 获取时间 | |
| total_amount | num | 漫读券总数 | |
| limits | array | (?) | |
| type_num | num | 7福利券 | |
| will_expire | num | 是否即将过期?<br />0<br />1是 | |
| discount | num | 0 | |
| discount_limit | num | 0 | |
| is_from_card | num | 0 | |
| valid_time | str | 0001-01-01 | |
| discount_base | num | 0 | |
`coupon_info` 对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| new_coupon_num | num | | |
| coupon_will_expire | num | | |
| rent_will_expire | num | | |
| new_rent_num | num | | |
| discount_will_expire | num | | |
| new_discount_num | num | | |
| month_ticket_will_expire | num | | |
| new_month_ticket_num | num | | |
| silver_will_expire | num | | |
| new_silver_num | num | | |
| remain_item | num | | |
| remain_discount | num | | |
| remain_coupon | num | 拥有的漫读券数量 | |
| remain_silver | num | 拥有的通用券数量 | |
| remain_shop_coupon | num | 拥有的商城优惠券数量 | |
| new_shop_num | num | | |
| shop_will_expire | num | | |
| new_suit_id | num | | |
| remain_suit_coupon | num | | |
| new_suit_num | num | | |
| suit_will_expire | num | | |
| vip_priv_coupon | bool | | |
**示例:**
```bash
curl -L -X POST 'https://manga.bilibili.com/twirp/user.v1.User/GetCoupons' \
-H 'Cookie: SESSDATA=xxx;' \
-H 'Content-Type: application/json' \
--data-raw '{
"notExpired": true,
"pageNum": 1,
"pageSize": 20,
"tabType": 1,
"type": 0
}'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": {
"total_remain_amount": 1,
"user_coupons": [
{
"ID": 7473503,
"remain_amount": 1,
"expire_time": "2022-05-24 12:00:33",
"reason": "积分兑换",
"type": "福利券",
"ctime": "2022-05-17 12:00:33",
"total_amount": 1,
"limits": [],
"type_num": 7,
"will_expire": 0,
"discount": 0,
"discount_limit": 0,
"is_from_card": 0,
"valid_time": "0001-01-01",
"discount_base": 0
}
],
"coupon_info": {
"new_coupon_num": 0,
"coupon_will_expire": 0,
"rent_will_expire": 0,
"new_rent_num": 0,
"discount_will_expire": 0,
"new_discount_num": 0,
"month_ticket_will_expire": 0,
"new_month_ticket_num": 0,
"silver_will_expire": 0,
"new_silver_num": 0,
"remain_item": 0,
"remain_discount": 0,
"remain_coupon": 1,
"remain_silver": 8,
"remain_shop_coupon": 1,
"new_shop_num": 0,
"shop_will_expire": 0,
"new_suit_id": 60007,
"remain_suit_coupon": 0,
"new_suit_num": 0,
"suit_will_expire": 0,
"vip_priv_coupon": false
}
}
}
```
</details>
# 获取已购漫画
> https://manga.bilibili.com/twirp/user.v1.User/GetAutoBuyComics
*请求方式POST*
认证方式CookieSESSDATA/ APP
**URL参数**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| -------- | ---- | ---- | ------ | ---- |
| device | str | 设备 | 非必要 | |
| platform | str | 平台 | 非必要 | |
**正文参数( application/json **
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| -------- | ---- | ------------------------ | ------ | ------------------------------------------------- |
| page_num | num | 页数 | 必要 | |
| page_size | num | 分页大小 | 必要 | 默认15 |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | ---------- | -------- | ------- |
| code | num | 返回值 | 0成功 |
| msg | str | 错误信息 | |
| data | obj(array) | | |
`data`array中的对象
| 字段 | 类型 | 内容 | 备注 |
| ---------------- | ---- | ---------------- | ---- |
| id | num | 内部id | |
| comic_id | str | 漫画id | |
| comic_title | str | 漫画标题 | |
| hcover | str | 横版头图 | |
| scover | str | 方形头图 | |
| vcover | str | 竖版封面图 | |
| bought_ep_count | num | 已购章节数 | |
| gold_status | num | | |
| coupon_status | num | | |
| comic_status | num | 漫画状态 | |
| last_ord | num | 最后一话 | |
| ctime | str | 获取时间 | |
| last_short_title | str | 最后一话的短标题 | |
| bug_type | num | 购买类型 | |
| ep_for_chapters | num | | |
| orders | obj | 自动扣费顺序 | |
| enable_auto_pay | bool | 是否开启自动付费 | |
| type | num | | |
**示例**
```bash
curl -L -X POST 'https://manga.bilibili.com/twirp/user.v1.User/GetAutoBuyComics' \
-H "Cookie: xxxxx" \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36' \
-d '{"page_num": 1,"page_size": 15}'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": [
{
"id": 20276887,
"comic_id": 26554,
"comic_title": "擅长捉弄的(原)高木同学",
"hcover": "http://i0.hdslb.com/bfs/manga-static/443b4a49be1e92cd204af1472e2a7f41c1df7336.png",
"scover": "http://i0.hdslb.com/bfs/manga-static/e29eb39aed0971851efe5998d3b9c156ba52bb4e.jpg",
"vcover": "http://i0.hdslb.com/bfs/manga-static/9536b3d6c6eaef5992986d6b06d35188c20f4366.jpg",
"bought_ep_count": 13,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 235,
"ctime": "2022-01-26 21:39:33",
"last_short_title": "235",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
},
{
"id": 15129353,
"comic_id": 29726,
"comic_title": "NEW GAME!",
"hcover": "https://i0.hdslb.com/bfs/manga-static/586df1c03978ef01eac9e6a670f26395f6495ead.jpg",
"scover": "https://i0.hdslb.com/bfs/manga-static/7110c8751fef26b082b5452bd515736a78bf0670.jpg",
"vcover": "https://i0.hdslb.com/bfs/manga-static/d3aa1477dcc9720f9bcee19c775849baad6b4e66.jpg",
"bought_ep_count": 4,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 180,
"ctime": "2021-06-21 16:29:27",
"last_short_title": "180",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
},
{
"id": 13525712,
"comic_id": 28080,
"comic_title": "终将成为你",
"hcover": "https://i0.hdslb.com/bfs/manga-static/bed69097d5fdc68bff87fce1e168b810448ee145.jpg",
"scover": "https://i0.hdslb.com/bfs/manga-static/855e851b58c805b05b347fddb80a46dcb260afac.jpg",
"vcover": "https://i0.hdslb.com/bfs/manga-static/10e8243b502bd19947cd49a6ac2ea0a9b8c5daa3.jpg",
"bought_ep_count": 5,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 45,
"ctime": "2021-04-09 08:26:41",
"last_short_title": "第45话",
"buy_type": 9,
"ep_for_chapters": 0,
"orders": [],
"enable_auto_pay": false,
"type": 0
},
{
"id": 13469083,
"comic_id": 28198,
"comic_title": "米诺斯的牛肉100%",
"hcover": "http://i0.hdslb.com/bfs/manga-static/75931d991ddd40bc49c655ff3fca770d45eac9aa.jpg",
"scover": "http://i0.hdslb.com/bfs/manga-static/ee37104f5d97bb486e69d660d9a93242a1c2817a.jpg",
"vcover": "http://i0.hdslb.com/bfs/manga-static/be5400d37c1428ecc98a8e2d1772175991a262ed.jpg",
"bought_ep_count": 1,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 6,
"ctime": "2021-04-06 12:21:20",
"last_short_title": "6",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [],
"enable_auto_pay": false,
"type": 0
},
{
"id": 13436048,
"comic_id": 27545,
"comic_title": "宝石之国",
"hcover": "http://i0.hdslb.com/bfs/manga-static/94637fff52eca04a8f32e19ed0c2f676b9bee96e.png",
"scover": "http://i0.hdslb.com/bfs/manga-static/e538ce332a639809aea70c8e30a19645e9b2ae3e.jpg",
"vcover": "http://i0.hdslb.com/bfs/manga-static/91e03718b03b7d3a2dca53c461b4b84953ce8cb0.jpg",
"bought_ep_count": 11,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 96,
"ctime": "2021-04-05 00:09:17",
"last_short_title": "96",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
},
{
"id": 13237163,
"comic_id": 27877,
"comic_title": "极主夫道",
"hcover": "https://i0.hdslb.com/bfs/manga-static/5a8b7bd678e2ae135415af31493417ae77bc83dd.png",
"scover": "http://i0.hdslb.com/bfs/manga-static/aa36b8cff89e42c1820e43c483d483ed3eb8d938.png",
"vcover": "http://i0.hdslb.com/bfs/manga-static/96a6b07bcea58955efed4df876bc8f1b5df9d5cc.jpg",
"bought_ep_count": 6,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 96,
"ctime": "2021-03-27 12:28:27",
"last_short_title": "96",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
},
{
"id": 12913068,
"comic_id": 25519,
"comic_title": "四月是你的谎言",
"hcover": "http://i0.hdslb.com/bfs/manga-static/33cda8ed8e6c89691d5397dc47f8c7c7945a54c4.png",
"scover": "http://i0.hdslb.com/bfs/manga-static/a6ed17ddac9bb568cefeb4eda8f8f3298db6c8cd.jpg",
"vcover": "http://i0.hdslb.com/bfs/manga-static/6d82d75a9a2817a18e16e2b82f76312d0fd02d06.jpg",
"bought_ep_count": 36,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 44,
"ctime": "2021-03-11 23:58:50",
"last_short_title": "44",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
},
{
"id": 12793711,
"comic_id": 28537,
"comic_title": "前男友成为了那样的男子",
"hcover": "https://i0.hdslb.com/bfs/manga-static/33440f7675a424dcce35459e2392e23e9d345531.jpg",
"scover": "http://i0.hdslb.com/bfs/manga-static/3de961215ad2a96ccf5dbb45d85db88934b545cb.jpg",
"vcover": "https://i0.hdslb.com/bfs/manga-static/77feff2a5f1aab93060e8ce5105e5616cb7313a7.jpg",
"bought_ep_count": 3,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 54,
"ctime": "2021-03-06 19:20:03",
"last_short_title": "44",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
},
{
"id": 12751111,
"comic_id": 26009,
"comic_title": "辉夜大小姐想让我告白 ~天才们的恋爱头脑战~",
"hcover": "https://i0.hdslb.com/bfs/manga-static/7fe349fd5a3d9522546e1582ad03604e82b1ff41.png",
"scover": "http://i0.hdslb.com/bfs/manga-static/b0ac1e3379e940c47b31209edf016e32e8bcee37.jpg",
"vcover": "https://i0.hdslb.com/bfs/manga-static/6188cad7ec7ac2b0555c0a815f9d2afbe7c0c5cb.jpg",
"bought_ep_count": 2,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 259,
"ctime": "2021-03-05 00:16:13",
"last_short_title": "269",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
},
{
"id": 12479079,
"comic_id": 27867,
"comic_title": "邪神与厨二病少女",
"hcover": "https://i0.hdslb.com/bfs/manga-static/96594b34528640f51ef5062648b55c871f4d4b1b.jpg",
"scover": "https://i0.hdslb.com/bfs/manga-static/54a7f8d35024ef46dc270dc758d882bc98c4a1c5.jpg",
"vcover": "https://i0.hdslb.com/bfs/manga-static/1b07c3be74d65cbb707934de190af10ca81588f3.jpg",
"bought_ep_count": 194,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 216.5,
"ctime": "2021-02-23 00:18:06",
"last_short_title": "216.5",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
},
{
"id": 11749927,
"comic_id": 29119,
"comic_title": "足艺少女小村同学",
"hcover": "https://i0.hdslb.com/bfs/manga-static/30b7917fd7d8b0afe6d913f09bab31e5eafae8b6.jpg",
"scover": "https://i0.hdslb.com/bfs/manga-static/f4ec445bc209ad473cdf9127528c09e271535617.jpg",
"vcover": "https://i0.hdslb.com/bfs/manga-static/8f83793c06dc0f59cab3a6acf4b978dc3c0a01f9.jpg",
"bought_ep_count": 13,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 58,
"ctime": "2021-01-31 11:04:31",
"last_short_title": "最终话",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
},
{
"id": 11605399,
"comic_id": 29053,
"comic_title": "如果是理想中的女儿,就算是世界最强也能受到宠爱吗?",
"hcover": "https://i0.hdslb.com/bfs/manga-static/5a7886e2b94515ea75a3ea34d9c77db3f2487b59.jpg",
"scover": "https://i0.hdslb.com/bfs/manga-static/88f6d08fed2998aba96cedbfdffba555bef4d1c1.jpg",
"vcover": "https://i0.hdslb.com/bfs/manga-static/517a155372e7de966cca2f5f42edabd31a90b169.jpg",
"bought_ep_count": 5,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 28,
"ctime": "2021-01-25 19:40:15",
"last_short_title": "28",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
},
{
"id": 11386175,
"comic_id": 28656,
"comic_title": "就算这样,“步”还是靠了过来",
"hcover": "http://i0.hdslb.com/bfs/manga-static/c95456b2d00f84293bda62b12539d19172b45db1.jpg",
"scover": "http://i0.hdslb.com/bfs/manga-static/2601c1474cd214d28797381e70b2c19ac7d67869.jpg",
"vcover": "https://i0.hdslb.com/bfs/manga-static/3a556ed655ddf84c7930b3ce180fbdbf8f1d8112.jpg",
"bought_ep_count": 2,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 160,
"ctime": "2021-01-17 10:48:29",
"last_short_title": "160",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
},
{
"id": 11356706,
"comic_id": 26731,
"comic_title": "在魔王城说晚安",
"hcover": "https://i0.hdslb.com/bfs/manga-static/061f63826f1aa24a5b9346f79b915999004b13da.jpg",
"scover": "http://i0.hdslb.com/bfs/manga-static/94ae037dae4cc61d580c5c3c42702ccf10d977dc.jpg",
"vcover": "https://i0.hdslb.com/bfs/manga-static/2958043a10024ddebfafc4fd47d3566043689300.jpg",
"bought_ep_count": 148,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 292,
"ctime": "2021-01-16 11:25:47",
"last_short_title": "292",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
},
{
"id": 11079049,
"comic_id": 27355,
"comic_title": "堀与宫村",
"hcover": "https://i0.hdslb.com/bfs/manga-static/b51b905707664415dab91cf81fb0373f970b54b5.jpg",
"scover": "https://i0.hdslb.com/bfs/manga-static/6ac604dfd0ad6c486a520519983212d74c340f28.jpg",
"vcover": "https://i0.hdslb.com/bfs/manga-static/c29ba3ce67613539666582d31d42b40fb48cc3c7.jpg",
"bought_ep_count": 119,
"gold_status": 2,
"coupon_status": 2,
"comic_status": 0,
"last_ord": 126,
"ctime": "2021-01-05 12:52:59",
"last_short_title": "page.122",
"buy_type": 0,
"ep_for_chapters": 0,
"orders": [
{
"id": 2,
"title": "漫读券"
},
{
"id": 3,
"title": "通用券"
},
{
"id": 1,
"title": "漫币"
}
],
"enable_auto_pay": false,
"type": 0
}
]
}
```
</details>

277
docs/manga/index_file.md Normal file
View File

@@ -0,0 +1,277 @@
# data.index
- [data.index文件解析](#data.index文件解析)
- [获取data.index](#获取data.index)
- [文件解密算法](#文件解密算法)
- [进行解密操作](#进行解密操作)
- [data.index内容](#data.index内容)
---
## data.index文件解析
本解密及数据解析例程以《在魔王城说晚安 第 1 话 不眠之城的公主》为例
本话链接https://manga.bilibili.com/mc26731/329893 mcid=`26731`, epid=`329893`
使用 Python 语言为例
### 获取data.index
直接使用 GET 方法请求该话对应的 data.index 文件地址,就会得到一个二进制文件
```bash
curl -s 'https://manga.hdslb.com/bfs/manga/26731/329893/data.index?token=4b93ced19dc5ade671064804232ef4f5&ts=634e1943' | hexdump -C
```
data.index 文件内容的 HEX 如下
首部有 9 Byte 作为 File Magic 内容是 ASCII 编码的 `BILICOMIC`
```
00000000 42 49 4c 49 43 4f 4d 49 43 f5 43 06 04 7f 68 08 |BILICOMIC.C...h.|
00000010 00 ad 08 05 00 6b 68 00 00 a5 08 05 00 6b 68 00 |.....kh......kh.|
00000020 00 a5 08 0c 00 6b 68 69 6e c1 6d 7d 2e 0f 09 74 |.....khin.m}...t|
00000030 ec 33 c3 8f 5c 2c 64 86 df 40 a4 82 58 9c 42 f5 |.3..\,d..@..X.B.|
00000040 ab 21 51 4d aa f9 f1 e0 84 84 9b 40 12 58 87 1e |.!QM.......@.X..|
00000050 ba 28 29 7d ce 89 04 03 d9 91 8d fd 7e 31 1d be |.()}........~1..|
00000060 ba d8 35 ef cb a0 83 db 71 5e f1 ee f1 90 19 43 |..5.....q^.....C|
00000070 03 dd 32 f7 b8 7a b7 07 7f b9 3f 7d 3a d5 54 7e |..2..z....?}:.T~|
00000080 5f fa e2 bd c1 90 bb 0f 9c 7d 34 e4 f0 49 2f 17 |_........}4..I/.|
00000090 39 1b c0 cc 45 25 47 72 76 34 13 12 b9 12 f9 f3 |9...E%Grv4......|
000000a0 8b b9 56 13 72 be 60 5e 55 27 5f 98 e0 3e 41 78 |..V.r.`^U'_..>Ax|
000000b0 d5 af 56 d0 82 3c d5 e0 55 94 70 d0 0c 16 5f 33 |..V..<..U.p..._3|
000000c0 c5 bb 14 d7 e9 e5 4a 7c 7f db 04 ea 7b 9b 90 94 |......J|....{...|
000000d0 fd 53 e1 d2 f8 86 1b 7c ea 97 dd 0b 22 33 75 39 |.S.....|...."3u9|
000000e0 24 76 39 38 6d 58 a4 ed b4 14 8f 71 49 95 9c cb |$v98mX.....qI...|
000000f0 eb 42 eb ec df a2 22 ae 39 0c 3d 03 95 43 27 55 |.B....".9.=..C'U|
00000100 c1 c8 b2 37 2c 01 b0 f4 22 7c 51 1a 93 b5 ab 6d |...7,..."|Q....m|
00000110 72 95 0c 33 9a ed 2d d6 22 f0 08 b6 5c bb f6 b5 |r..3..-."...\...|
00000120 07 5f cf a1 3a 66 c8 30 41 29 31 dd 17 63 46 85 |._..:f.0A)1..cF.|
00000130 ea 53 20 a0 aa 89 65 91 78 37 ac 4b 06 e6 59 7a |.S ...e.x7.K..Yz|
00000140 c2 b7 10 56 cc a0 2e 85 94 09 01 89 83 43 82 a4 |...V.........C..|
00000150 db 60 91 89 15 83 aa 45 aa d6 5f fd 6a 64 f9 1c |.`.....E.._.jd..|
00000160 9d ef c3 6c 34 85 e7 49 8a a7 c3 bc 32 09 eb b8 |...l4..I....2...|
00000170 ef 70 ab d6 6a d2 7f f6 96 b1 9a 75 eb f8 47 34 |.p..j......u..G4|
00000180 db 1d 99 78 57 58 04 4e e0 c4 a4 58 d8 81 f5 02 |...xWX.N...X....|
00000190 3c 42 7e 1c 27 98 3c 70 df 04 13 33 fa ff 21 3b |<B~.'.<p...3..!;|
000001a0 6c b4 52 ed 16 27 c8 c9 3a a5 fb 21 b9 dc a9 8a |l.R..'..:..!....|
000001b0 68 0a 38 f0 4c 33 55 96 a8 a5 dd b1 1a 75 b0 26 |h.8.L3U......u.&|
000001c0 83 ea a4 49 23 03 77 42 bd f3 f1 5d 82 a8 73 67 |...I#.wB...]..sg|
000001d0 2f ef 67 49 14 69 8c b9 d6 62 2c 8d 43 93 f2 b9 |/.gI.i...b,.C...|
000001e0 d2 bd 21 4f 2d 48 20 f6 02 d0 05 17 d3 8e 1b 9d |..!O-H .........|
000001f0 58 6c 6a 67 a9 ef 64 ca 4d 9c 40 17 c3 6f 2a 70 |Xljg..d.M.@..o*p|
00000200 36 0b 14 4c 51 a9 4f ff b9 75 42 b2 8f 2c fb c3 |6..LQ.O..uB..,..|
00000210 d1 13 2c 0b de 48 24 64 24 6f 88 b4 eb af cf ce |..,..H$d$o......|
00000220 66 3a 12 58 dc 3f c5 03 94 a3 e1 ef 1d 59 ca d5 |f:.X.?.......Y..|
00000230 58 07 b8 e3 c9 71 b2 e0 c9 15 54 4c cd e1 62 19 |X....q....TL..b.|
00000240 66 4e 02 f0 a0 85 8c a4 b5 f6 47 e3 c9 dd c3 54 |fN........G....T|
00000250 4d fc c8 45 e7 8f 22 00 68 e0 46 f4 ec 19 b4 b0 |M..E..".h.F.....|
00000260 f8 01 53 21 68 ad 49 6b 37 f5 fa 5f 0e 18 07 f3 |..S!h.Ik7.._....|
00000270 14 bf 03 59 f4 d5 5e a7 9c fd e1 90 9b 18 a9 12 |...Y..^.........|
00000280 b1 a7 2c 52 1d d2 b8 81 c7 3d 22 6f 5b de f9 4e |..,R.....="o[..N|
00000290 ba 38 c0 84 99 5d e3 7b ba 04 e1 e1 9a 0d bc 31 |.8...].{.......1|
000002a0 ef 6e 79 5c 38 e7 1d 72 9a 51 ea 55 6e fb a1 b8 |.ny\8..r.Q.Un...|
000002b0 75 29 b3 06 a9 52 10 53 17 24 e6 84 4b 00 f5 59 |u)...R.S.$..K..Y|
000002c0 81 28 ad cd cc dd a9 a6 56 a5 06 e7 65 39 6b 89 |.(......V...e9k.|
000002d0 5c 13 ba 51 c0 48 91 fc 74 19 b5 f9 bd d4 d5 44 |\..Q.H..t......D|
000002e0 ea 6a e7 02 6c 96 9d ed 2d d7 37 49 7f c3 e2 cd |.j..l...-.7I....|
000002f0 ff 0e f7 90 ea 88 7e bc 17 4a df e5 fb 98 93 3f |......~..J.....?|
00000300 01 a5 08 fa ff 3b 23 07 08 ac 60 82 8a be 6a 00 |.....;#...`...j.|
00000310 00 dd 02 05 00 3b 23 01 02 b1 08 11 00 63 68 08 |.....;#......ch.|
00000320 00 a5 08 05 00 62 00 87 8a 70 0a 05 00 13 62 00 |.....b...p....b.|
00000330 00 ac 08 05 00 6b 68 00 00 a5 08 05 00 6b 68 00 |.....kh......kh.|
00000340 00 a5 08 6c 6e 0f 0d 78 2e c1 69 71 50 20 6d 06 |...ln..x..iqP m.|
00000350 00 a5 08 05 01 6b 69 00 37 a5 08 05 0c 68 68 00 |.....ki.7....hh.|
00000360 00 a5 |..|
```
### 文件解密算法
首先以`mcid`对应漫画id以及`epid`(对应单话)生成一个 8 Byte 的数组作为密钥
具体内容为前 4 Byte 为 epid 后 4 Byte 为 mcid字节排序均为小端序 MSB First
接下来从返回数据的 09H 处开始,逐字节与密钥取单个字节进行 **XOR异或**运算,密钥数组每 8 Byte 循环一次
解密成功的数据是一个 zip 格式的压缩文件,提取`index.dat`中的数据并以 JSON 数据解析就完成了
### 进行解密操作
`mcid=26731` `epid=329893`,计算得到的数组便是密钥
```python
mcid = 26731
epid = 329893
key = list(epid.to_bytes(4, 'little') + mcid.to_bytes(4, 'little'))
print(key)
```
```python
[165, 8, 5, 0, 107, 104, 0, 0]
```
拉取索引数据并解密,需要**跳过前 9 Byte**,这时候已经能看到数据具有 zip 格式压缩文件的特征,前两 Byte 为 “PK”50H 4BH
```python
import requests
data = requests.get('https://manga.hdslb.com/bfs/manga/26731/329893/data.index?token=0ba7042d3a5d138c59151316a1914058&ts=634e53fb').content
temp = bytearray(data[9:])
for i in range(len(temp)):
temp[i] ^= key[i % 8]
print(temp)
```
```python
bytearray(b'PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x00\x00index.dat\xec\x96\xcb\x8a\\G\x0c\x86\xdf\xe5\xac\x87X\xf7*\xf5\xab\x84YH\xaa\x92\x99\xe0\x84!\x93E\x123\xef\x1e\xba\x8d!x\xce\xe2l\x03\xd94\x85\xf8~Zu\xbe\xba}=\xea\xcb\xcb\xeb\xdbq\xfb\xf9\xeb\xf1\xfbqC\x03x:\xf2\xb8\x11\xdf\x07\x7f\x1c7x:\xbe<~__\xea\xb8\xc1\xfb\xd3\x0f\x9c\xd8<\xe1\xf0"G\x179\xbe\xc8\xc9EN/rv\x91\x1b\x17\xb9y\x91\xf3\x8b\x1c^\x16r\xd5\x08^U\x82W\x9d\xe0U)x\xd5\n^\xd5\x82W\xbd\xe0U1x\xd5\x0c}73\xc5\x1e\x1c\xd2\xe9\x8e"|\x7f~\x0c\xef{\xf0\xf8\x94\xfd\xf6\xe9\xd7\xf8\xeds|\xea2\xd5\x0e"X\x1d9$\xd31=m3\xcc\xed\xb4\xb1\x87tI\xfe\xf4\xcb\xeb\xe7\xe3\xe9\xdf\xc9J\xae9\xa95\x06\x95(OU\xc1m\xba2,j\xd8\xf4"\xd9Y\x1f\x93\xde\xc3mr0\x046\x9a\x86E\xd6"U\x00\xb3\\\xd0\x9e\xb5\x07\xfa\xc7\xa4:\r\xa00A\x8c9\xd8\x17\x08.\x85\xea\xf6(\xa5\xaa\xe2\r\x91x\x92\xa4N\x06\x8d1z\xc2\x12\x18S\xcc\xcbF\x85\x94\xac\t\x8c\x83(\xea\xa4\xdb\xc5\x99\x8c\x15\xe8\xc2E\xaasW\xf8j\x0f\x91\x1c\x9dJ\xcbi4\xee\x8fI\x8a\x02\xcb\xb92b\x83\xb8\xef\xd5\xa3\xd3j\xb9\x17\xf6\x96\x14\x92p\xeb\x93/4\xdb\xb8\x91}W3lN\xe0a\xac]\xd8\xea\x9d\x02<\xe7v\x19\'\xf3Tp\xdf\xa1\x1b6\xfa\x94I;l\x11Z\xe8\x16L\xa0\xc9:\x00\xf3$\xb9\xb7\xc1\x8ah\xaf0\xf5LX=\x96\xa8\x00\xd5\xb4\x1a\x1e\xd8&\x83O\xacL#h\x1fB\xbdV\xf9X\x82\xc3\x1bg/JoL\x14\x02\xe4\xb9\xd6\xc7$\x88C\xf8\x9a\xb9\xd2\x18)J-#H\xf6\x02u\r\x12\xd3\xe5s\x9dX\xc9bb\xa9\x84\x0c\xcaM9H\x12\xc3\x04Bp6\xae\x1cIQ\xc2\'\xff\xb9\xd0J\xb7\x8fG\x93\xc3\xd1\xb6$\x0e\xde#Ld$\xca\x80\xb1\xeb\xc4\xa7\xcef\x9f\x1a]\xdcT\xad\x03\x94\x06\xe9\xea\x1d2\xa2\xd5X\xa2\xb0\xe6\xc9\x1a\xda\xe0\xc9\xb0\\I\xcd\x8a\n\x19f\xeb\n\xf5\xa0\xee\xe4\xa4\xb5SO\xe6\xc9\xb6\xabTMY\xc0@\xe7\xe4J\x00hEN\xf1\xecr\xdc\xb0\xf8\xa4[$h\xc6!k7P\xf2Z\x0eso\xf3\x14\x1a\x0b\\\xf4\xbe6\xa7\x9cX\xe9\x95\x9bs\xc1\x12\xb1\x02$W\x1d\xb9\xd0\x81\xc7\x98*j[\xb5\x91N\xba\x9d\xc8\x81\x996\x8b{\xba\xa1\xe9\xe4\x9af\xd41\xef\xcbqY8\x8cur\x9a\xf4\xe2Pn\x90\xc9\xb8u\x8c\xbb\x03\xa99xS\x17\x81\xee\x81Kk\x9dY\x81\x8d\xa5\xc8\xcc\xb6\xc1\xa6V\x00\x0e\xe2eR\x03\x89\\\xb6\xb2T\xc0#\xf9\xfct\xbc\xbd\xfc\xbd\xbf\xbdD\xea\xcf\xef\x07l\xfd\xf5\xed-r?L\x7f\xa8\x8a\xcd\xff\xab\xff\x95\xea\xe3\x16\xbc\x17\xef\xd7\xe0\xfb\xf3\xfb?\x01\x00\x00\xff\xffPK\x07\x08\th\x87\x8a\xd5\x02\x00\x00x\n\x00\x00PK\x01\x02\x14\x00\x14\x00\x08\x00\x08\x00\x00\x00\x00\x00\th\x87\x8a\xd5\x02\x00\x00x\n\x00\x00\t\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00index.datPK\x05\x06\x00\x00\x00\x00\x01\x00\x01\x007\x00\x00\x00\x0c\x03\x00\x00\x00\x00')
```
进行解压缩数据,提取`index.dat`中的数据
```python
import zipfile
from io import BytesIO
with zipfile.ZipFile(BytesIO(temp)) as zf:
index_data = zf.read('index.dat')
print(index_data)
```
JSON 内容如下:
<details>
<summary>查看json内容</summary>
```json
{
"clips": [
{"r": 1600, "b": 2300, "t": 0, "l": 0, "pic": 0},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 1},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 2},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 3},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 4},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 5},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 6},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 7},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 8},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 9},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 10},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 11},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 12},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 13},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 14},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 15},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 16},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 17},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 18},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 19},
{"r": 1600, "b": 2468, "t": 0, "l": 0, "pic": 20},
{"r": 846, "b": 1200, "t": 0, "l": 0, "pic": 21}
],
"pics": [
"/bfs/manga/fc655fa220dfab74bb91b9b6e308e92e1f74fc4b.jpg",
"/bfs/manga/cb3c882f5a72c45385541e65dba6ac7689c24ebc.jpg",
"/bfs/manga/9f79683a30a1f165a6abcd2550066bd0f9bce719.jpg",
"/bfs/manga/592702a6411a8739d041d50cff9ac52ccc3e0ab1.jpg",
"/bfs/manga/52fb305a77f80d4078469c67ca4c4d8031722acc.jpg",
"/bfs/manga/d3bb31ca1943c2558eca9df9a44b7fb52d927f1e.jpg",
"/bfs/manga/2ac06b8dbaae0499edf7fb6cd99c1fe4b424a96f.jpg",
"/bfs/manga/98f63f139ecf30e3b037635fc1f59fb40388e947.jpg",
"/bfs/manga/55099ea5e0e198482ea6d216a5e41b02835701b7.jpg",
"/bfs/manga/ee60daaf9ca659bb0df7d45402c86c79a1f64739.jpg",
"/bfs/manga/8620f9742fddc97d4179f18fd2b9f1b1420138dd.jpg",
"/bfs/manga/0490a9d8bdb6312ac56baa24ed0595a2465d98dc.jpg",
"/bfs/manga/bc3234cb0ba2be2b724b1a640a418f1db7b2ac43.jpg",
"/bfs/manga/0d16c5e9779f187916e4b173e7a6447b14707ece.jpg",
"/bfs/manga/58f3985afc3f2cf57052725dfea47af5634ac1c8.jpg",
"/bfs/manga/de09b30d952566c2c1308f5da59a2ffb3b2deb5c.jpg",
"/bfs/manga/36ecc5565340605883cb000f513b49bfc91e0d3e.jpg",
"/bfs/manga/120f3174def02b3dd908ee69b427d094506b884d.jpg",
"/bfs/manga/fdbe3bd0d446c0129557bd19037785456e55f12c.jpg",
"/bfs/manga/813a1bb68c3f89616583c8662fa81984d6a907db.jpg",
"/bfs/manga/fd3a53f04831e577707e4c873e2fc205e71d5cde.jpg",
"/bfs/manga/50e1c513336e0685ca01723d64c712294e534ca0.jpg"
],
"sizes": [
{"cx": 1600, "cy": 2300},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 1600, "cy": 2468},
{"cx": 846, "cy": 1200}
]
}
```
</details>
## data.index内容
以下内容为解密后的 JSON 数据定义
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ----- | ----- | -------- | ---- |
| clips | array | 尺寸信息 | |
| pics | array | 图片路径 | |
| sizes | array | 尺寸信息 | |
根对象中的`clips`数组:
| 项 | 类型 | 内容 | 备注 |
| ---- | ---- | --------------- | ---- |
| 0 | obj | 第 1 页信息 | |
| n | obj | 第 (n+1) 页信息 | |
| …… | obj | …… | …… |
`clips`数组中的对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- | ------------ | ------------- |
| r | num | 图片宽度 | |
| b | num | 图片高度 | |
| t | num | (?) | |
| l | num | (?) | |
| pic | num | 图片页码序号 | 从 0 开始递增 |
根对象中的`pics`数组:
| 项 | 类型 | 内容 | 备注 |
| ---- | ---- | ----------------- | ------------------------------ |
| 0 | str | 第 1 图片路径 | 图片不能直接访问,需要二次鉴权 |
| n | str | 第 (n+1) 图片路径 | |
| …… | str | …… | …… |
根对象中的`sizes`数组:
| 项 | 类型 | 内容 | 备注 |
| ---- | ---- | --------------- | ---- |
| 0 | obj | 第 1 页信息 | |
| n | obj | 第 (n+1) 页信息 | |
| …… | obj | …… | …… |
`clips`数组中的对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- | -------- | ---- |
| cx | num | 图片宽度 | |
| cy | num | 图片高度 | |

204
docs/manga/light_card.md Normal file
View File

@@ -0,0 +1,204 @@
# 获取轻享卡信息
> https://manga.bilibili.com/twirp/card.v1.Card/GetUserLightCard
*请求方式POST*
是否需要登录:`是`
认证方式CookieSESSDATA/ APP
Content-Type`application/x-www-form-urlencoded`
**URL参数**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
|------------|-----|----------------|-----|-----------------|
| access_key | str | 登录`access_key` | | 与`SESSDATA`二选其一 |
**json回复**
根对象:
| 字段名 | 类型 | 内容 | 备注 |
|------|-----|------|------|
| code | num | 响应码 | 0成功 |
| msg | str | | |
| data | obj | 信息本体 | |
`data`对象:
| 字段名 | 类型 | 内容 | 备注 |
|--------------------|-------|----------------|---------------------------------|
| state | num | 轻享卡开通状态 | 0未开通<br/>1已开通 |
| show_state | num | | |
| expire_date | str | 轻享卡到期时间 | |
| receive_amount | num | 已领取数量 | |
| save_money | num | 已节省漫币 | |
| index | num | 默认选择签到周期 | |
| week | array | 一个领取周期内的领取状态信息 | |
| month_reward_state | num | 是否可选择全勤奖 | 0不可领取<br/>1可领取<br/>2不可领取灰色 |
| month_reward | num | | |
| cur_month_end | str | 全勤奖领取剩余时间 | |
| server_time | str | 当前服务器时间 | |
`week`数组中的对象:
| 字段名 | 类型 | 内容 | 备注 |
|-------------------|-----|-------------|------------------------------------------------|
| index | num | 第几领取周期 | 从`1`开始 |
| start_time | str | 本周期领取开始时间 | 1待领取<br/>2已领取<br/>3明日可领<br/>4已失效<br/>5可领取 |
| end_time | str | 本周期领取结束时间 | `同上` |
| first | num | 本周期第1天的领取状态 | `同上` |
| second | num | 本周期第2天的领取状态 | `同上` |
| third | num | 本周期第3天的领取状态 | `同上` |
| fourth | num | 本周期第4天的领取状态 | `同上` |
| full_reward_state | num | 周期全勤奖领取状态 | 1不可领取<br/>2:可领取<br/>3已领取 |
**示例:**
`SESSDATA`方式:
```shell
curl -L -X POST 'https://manga.bilibili.com/twirp/card.v1.Card/GetUserLightCard' \
-H 'Cookie: SESSDATA=xxx'
```
`access_key`方式:
```shell
curl -L -X POST 'https://manga.bilibili.com/twirp/card.v1.Card/GetUserLightCard?access_key=xxx'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": {
"state": 1,
"show_state": 1,
"expire_date": "2023-03-09T23:59:59+08:00",
"receive_amount": 18,
"save_money": 890,
"index": 1,
"week": [
{
"index": 1,
"start_time": "2023-02-10T00:00:00+08:00",
"end_time": "2023-02-16T23:59:59+08:00",
"first": 5,
"second": 1,
"third": 1,
"fourth": 1,
"full_reward_state": 1
},
{
"index": 2,
"start_time": "2023-02-17T00:00:00+08:00",
"end_time": "2023-02-23T23:59:59+08:00",
"first": 1,
"second": 1,
"third": 1,
"fourth": 1,
"full_reward_state": 1
},
{
"index": 3,
"start_time": "2023-02-24T00:00:00+08:00",
"end_time": "2023-03-02T23:59:59+08:00",
"first": 1,
"second": 1,
"third": 1,
"fourth": 1,
"full_reward_state": 1
},
{
"index": 4,
"start_time": "2023-03-03T00:00:00+08:00",
"end_time": "2023-03-09T23:59:59+08:00",
"first": 1,
"second": 1,
"third": 1,
"fourth": 1,
"full_reward_state": 1
}
],
"month_reward_state": 0,
"month_reward": 0,
"cur_month_end": "2023-03-10T00:00:00+08:00",
"server_time": "2023-02-10T10:59:43+08:00"
}
}
```
</details>
# 领取轻享卡奖励
> https://manga.bilibili.com/twirp/card.v1.Card/GetLightCoupon
*请求方式POST*
是否需要登录:`是`
认证方式CookieSESSDATA/ APP
Content-Type`application/json`
**URL参数**
| 参数名 | 类型 | 必填 | 内容 | 备注 |
|------------|-----|----|-----------------|----|
| access_key | str | | 与`SESSDATA`二选其一 | |
**正文参数( application/json **
| 参数名 | 类型 | 必填 | 内容 | 备注 |
|-----------|-----|----|-----|--------|
| weekIndex | num | √ | 第几周 | 从`1`开始 |
| type | num | √ | 第几天 | 从`1`开始 |
**json回复**
根对象:
| 字段名 | 类型 | 内容 | 备注 |
|------|-----|-----|----------------------------------------------------|
| code | num | 响应码 | 0成功<br/>3今日已领取,请明日再来<br/>3还未满足领取条件<br/>4找不到数据~ |
| msg | str | | |
| data | obj | | |
**示例:**
`SESSDATA`方式:
```shell
curl -L -X POST 'https://manga.bilibili.com/twirp/card.v1.Card/GetLightCoupon' \
-H 'content-type: application/json; charset=utf-8' \
-H 'Cookie: SESSDATA=xxx' \
--data-raw '{"type":1,"weekIndex":1}'
```
`access_key`方式:
```shell
curl -L -X POST 'https://manga.bilibili.com/twirp/card.v1.Card/GetLightCoupon?access_key=xxx' \
-H 'content-type: application/json; charset=utf-8' \
--data-raw '{"type":1,"weekIndex":1}'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": {}
}
```
</details>

451
docs/manga/point_shop.md Normal file
View File

@@ -0,0 +1,451 @@
# 积分商城
- [获取当前持有点数](#获取当前持有点数)
- [获取兑换奖品列表](#获取兑换奖品列表)
- [兑换物品](#兑换物品)
- [获取兑换历史记录](#获取兑换历史记录)
- [获取玩法说明](#获取玩法说明)
*积分商城由web页面提供功能地址为*
> https://manga.bilibili.com/eden/credits-exchange.html
## 获取当前持有点数
> https://manga.bilibili.com/twirp/pointshop.v1.Pointshop/GetUserPoint
*请求方式POST*
认证方式CookieSESSDATA/ APP
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | |
| msg | str | 错误信息 | |
| data | obj | 信息本体 | |
`data`对象:
| 字段 | 类型 | 内容 | 备注 |
| -------- | ---- | -------- | ------------ |
| point | str | 点数 | 不登录时为0 |
**示例:**
```bash
curl 'https://manga.bilibili.com/twirp/pointshop.v1.Pointshop/GetUserPoint' \
-b 'SESSDATA=xxx'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": {
"point": "66666"
}
}
```
</details>
## 获取兑换奖品列表
> https://manga.bilibili.com/twirp/pointshop.v1.Pointshop/ListProduct
*请求方式POST*
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | |
| msg | str | 错误信息 | |
| data | array | 奖品列表 | |
`data`数组:
| 项 | 类型 | 内容 | 备注 |
| ---- | ---- | --------- | ---- |
| 0 | obj | 奖品1 | |
| n | obj | 奖品(n+1) | |
| …… | obj | …… | …… |
`data`数组中的对象:
| 字段 | 类型 | 内容 | 备注 |
| -------- | ---- | -------- | ------------ |
| id | num | 物品id | |
| type | num | 物品类型 | 0商城相关<br />3限免券<br />7福利券 |
| title | str | 物品名 | |
| image | str | 显示的图像 | 福利券为空 |
| amount | num | 库存总量 | |
| cost | num | 兑换所需点数(原价) | |
| real_cost | num | 兑换所需点数(现价) | |
| remain_amount | num | 库存剩余数 | |
| comic_id | num | 相关漫画id | |
| limits | array | 限定使用范围(漫画) | 限免券所适用的漫画 |
| discount | num | (?) | 目前恒为0 |
| product_type | num | 物品类型 | 1限免券、福利券<br />4商城满99立减10元券、商城5元无门槛券<br />5商城5魔晶 |
| pendant_url | str | (?) | |
| pendant_expire | num | (?) | 0限免券、福利券<br />7商城满99立减10元券、商城5元无门槛券、商城5魔晶 |
| exchange_limit | num | 兑换次数限制 | |
| address_deadline | str | (?) | |
| act_type | num | (?) | 目前恒为0 |
| has_exchanged | bool | 是否兑换过该物品 | |
| main_coupon_deadline | str | 兑换后使用截止时间 | |
| deadline | str | 兑换后使用截止时间 | |
| point | str | (?) | 目前恒为0 |
**示例:**
```bash
curl 'https://manga.bilibili.com/twirp/pointshop.v1.Pointshop/ListProduct'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": [
{
"id": 195,
"type": 7,
"title": "积分兑换",
"image": "",
"amount": 15999,
"cost": 200,
"real_cost": 100,
"remain_amount": 0,
"comic_id": 0,
"limits": [],
"discount": 0,
"product_type": 1,
"pendant_url": "",
"pendant_expire": 7,
"exchange_limit": 0,
"address_deadline": "0001-01-01T00:00:00Z",
"act_type": 0,
"has_exchanged": false,
"main_coupon_deadline": "0001-01-01T00:00:00Z",
"deadline": "",
"point": "0"
},
{
"id": 1009,
"type": 0,
"title": "商城5魔晶",
"image": "",
"amount": 500,
"cost": 260,
"real_cost": 30,
"remain_amount": 0,
"comic_id": 0,
"limits": [],
"discount": 0,
"product_type": 5,
"pendant_url": "",
"pendant_expire": 0,
"exchange_limit": 1,
"address_deadline": "0001-01-01T00:00:00Z",
"act_type": 0,
"has_exchanged": false,
"main_coupon_deadline": "2022-03-22T23:59:59+08:00",
"deadline": "2022-03-22T23:59:59+08:00",
"point": "0"
},
{
"id": 1008,
"type": 0,
"title": "商城满99立减10元券",
"image": "",
"amount": 400,
"cost": 2000,
"real_cost": 400,
"remain_amount": 390,
"comic_id": 0,
"limits": [],
"discount": 0,
"product_type": 4,
"pendant_url": "",
"pendant_expire": 0,
"exchange_limit": 1,
"address_deadline": "0001-01-01T00:00:00Z",
"act_type": 0,
"has_exchanged": false,
"main_coupon_deadline": "2022-03-22T23:59:59+08:00",
"deadline": "2022-03-22T23:59:59+08:00",
"point": "0"
},
{
"id": 1007,
"type": 0,
"title": "商城5元无门槛券",
"image": "",
"amount": 200,
"cost": 1000,
"real_cost": 200,
"remain_amount": 134,
"comic_id": 0,
"limits": [],
"discount": 0,
"product_type": 4,
"pendant_url": "",
"pendant_expire": 0,
"exchange_limit": 1,
"address_deadline": "0001-01-01T00:00:00Z",
"act_type": 0,
"has_exchanged": false,
"main_coupon_deadline": "2022-03-22T23:59:59+08:00",
"deadline": "2022-03-22T23:59:59+08:00",
"point": "0"
},
{
"id": 1536,
"type": 3,
"title": "白兔糖",
"image": "http://i0.hdslb.com/bfs/manga-static/c3369754789a77b5d0b15cc31c75538ac035b3aa.jpg",
"amount": 4000,
"cost": 100,
"real_cost": 75,
"remain_amount": 3991,
"comic_id": 27164,
"limits": [
{
"type": 1,
"id": 27164,
"title": "白兔糖"
}
],
"discount": 0,
"product_type": 1,
"pendant_url": "",
"pendant_expire": 7,
"exchange_limit": 0,
"address_deadline": "0001-01-01T00:00:00Z",
"act_type": 0,
"has_exchanged": false,
"main_coupon_deadline": "0001-01-01T00:00:00Z",
"deadline": "",
"point": "0"
}
]
}
```
</details>
## 兑换物品
> https://manga.bilibili.com/twirp/pointshop.v1.Pointshop/Exchange
*请求方式POST*
认证方式CookieSESSDATA/ APP
**正文参数( application/x-www-form-urlencoded 或 application/json**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ---------- | ---- | ------------------------ | -------------- | ------------------------------------------------------------ |
| product_id | str | 物品id | 必要 | |
| product_num | num | 兑换个数 | 必要 | |
| point | num | 物品所需点数 | 必要 | 现价real_cost |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | 0兑换成功<br />1积分不足<br />1您点的太快了~<br />2库存不足<br />3product point mismatchpoint填写错误<br />3超过用户最大可兑换数量<br />4现在抢票的人太多啦再点一下有机会优先上车喔 ε=ε=(ノ≧∇≦) |
| message | str | 错误信息 | |
**示例:**
```bash
curl 'https://manga.bilibili.com/twirp/pointshop.v1.Pointshop/Exchange' \
--data-urlencode 'product_id=195' \
--data-urlencode 'product_num=1' \
--data-urlencode 'point=real_cost' \
-b 'SESSDATA=xxx'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": ""
}
```
</details>
## 获取兑换历史记录
> https://manga.bilibili.com/twirp/activity.v1.Activity/GetPrizeList
*请求方式POST*
认证方式CookieSESSDATA/ APP
**正文参数( application/x-www-form-urlencoded 或 application/json**
| 参数名 | 类型 | 内容 | 必要性 | 备注 |
| ---------- | ---- | ------------------------ | -------------- | ------------------------------------------------------------ |
| act_id | num | 固定值90018 | 必要 | |
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ------- | ---- | -------- | ------------------------------------------------------------ |
| code | num | 返回值 | |
| msg | str | 错误信息 | | |
| data | obj | 信息本体 |
`data`对象:
| 字段 | 类型 | 内容 | 备注 |
| ------ | ---- | -------- | ---- |
| prizes | obj | 兑换记录 | |
| addr | obj | (?) | |
`data`中的`prizes`对象:
| 字段 | 类型 | 内容 | 备注 |
| -------- | ---- | -------- | ------------ |
| user_prize_id | str | 兑换id? | |
| prize_id | num | 兑换的物品id | |
| ctime | str | 兑换时间 | |
| addr | null | (?) | |
| deadline | str | 过期时间 | |
| type | num | 类型 | 1限免券、福利券<br />8商城5魔晶 |
| name | str | 物品名 | |
**示例:**
```bash
curl 'https://manga.bilibili.com/twirp/activity.v1.Activity/GetPrizeList' \
--data-urlencode 'act_id=90018' \
-b 'SESSDATA=xxx'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": {
"prizes": [
{
"user_prize_id": "55117444",
"prize_id": 1009,
"ctime": "2022-03-21T12:22:53+08:00",
"addr": null,
"deadline": "0001-01-01T00:00:00Z",
"type": 8,
"name": "商城5魔晶"
},
{
"user_prize_id": "2594073385420523088",
"prize_id": 1536,
"ctime": "2022-03-21T12:07:24+08:00",
"addr": null,
"deadline": "0001-01-01T00:00:00Z",
"type": 1,
"name": "白兔糖限免卡"
},
{
"user_prize_id": "4899916394614914913",
"prize_id": 195,
"ctime": "2021-12-24T12:01:08+08:00",
"addr": null,
"deadline": "0001-01-01T00:00:00Z",
"type": 1,
"name": "积分兑换"
},
{
"user_prize_id": "1152921504636496551",
"prize_id": 195,
"ctime": "2021-12-13T12:05:13+08:00",
"addr": null,
"deadline": "0001-01-01T00:00:00Z",
"type": 1,
"name": "积分兑换"
}
],
"addr": {
"name": "",
"phone": "",
"address": "",
"id_card": ""
}
}
}
```
</details>
## 获取玩法说明
> https://manga.bilibili.com/twirp/pointshop.v1.Pointshop/GetExchangeRule
*请求方式POST*
**json回复**
根对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- | -------- | ---- |
| code | num | 返回值 | |
| msg | str | 错误信息 | |
| data | obj | 信息本体 | |
`data`对象:
| 字段 | 类型 | 内容 | 备注 |
| ---- | ---- | -------- | ---- |
| rule | str | 玩法说明 | |
**示例:**
```bash
curl 'https://manga.bilibili.com/twirp/pointshop.v1.Pointshop/GetExchangeRule'
```
<details>
<summary>查看响应示例:</summary>
```json
{
"code": 0,
"msg": "",
"data": {
"rule": "日常兑换说明:\n1、赛季积分达到一定数量可兑换积分商城内相应的商品\n2、日常兑换奖品的刷新时间为每日中午12点每天可兑换的奖品总数有限具体可见商品页面展示请尽快兑换。\n3、兑换的福利券限免卡奖品有效期详见兑换框内显示或卡券包内详情说明哦请及时在有效期内使用。\n4、赛季积分有效期为当前赛季时长每期赛季时长详见福利中心页面倒计时显示请及时在有效期内进行使用。\n5、赛季积分可在福利中心完成特定任务获取具体详情可至福利中心查看部分活动也可获取赛季积分可随时关注活动信息哦。"
}
}
```
</details>