├── grpc_api
├── bilibili
│ ├── relation
│ │ └── interfaces
│ │ │ └── api.proto
│ ├── dagw
│ │ └── component
│ │ │ └── avatar
│ │ │ ├── v1
│ │ │ └── avatar.proto
│ │ │ └── common
│ │ │ └── common.proto
│ ├── dynamic
│ │ └── interfaces
│ │ │ └── campus
│ │ │ └── v1
│ │ │ └── api.proto
│ ├── community
│ │ ├── interfacess
│ │ │ └── biligram
│ │ │ │ └── v1
│ │ │ │ └── biligram.proto
│ │ └── service
│ │ │ └── govern
│ │ │ └── v1
│ │ │ └── govern.proto
│ ├── pangu
│ │ └── gallery
│ │ │ └── v1
│ │ │ └── openplatform
│ │ │ └── apiserver
│ │ │ └── v1alpha1
│ │ │ └── api.proto
│ ├── broadcast
│ │ ├── message
│ │ │ ├── esports
│ │ │ │ └── notify.proto
│ │ │ ├── note
│ │ │ │ └── sync.proto
│ │ │ ├── fission
│ │ │ │ └── notify.proto
│ │ │ ├── ticket
│ │ │ │ └── activitygame.proto
│ │ │ ├── editor
│ │ │ │ └── notify.proto
│ │ │ ├── main
│ │ │ │ ├── native.proto
│ │ │ │ ├── resource.proto
│ │ │ │ └── dm.proto
│ │ │ ├── ogv
│ │ │ │ └── live.proto
│ │ │ ├── tv
│ │ │ │ └── proj.proto
│ │ │ └── im
│ │ │ │ └── notify.proto
│ │ ├── v1
│ │ │ ├── laser.proto
│ │ │ ├── mod.proto
│ │ │ ├── test.proto
│ │ │ ├── room.proto
│ │ │ ├── broadcast.proto
│ │ │ └── push.proto
│ │ └── v2
│ │ │ └── laser.proto
│ ├── app
│ │ ├── viewunite
│ │ │ ├── ugcanymodel.proto
│ │ │ └── pgcanymodel.proto
│ │ ├── distribution
│ │ │ ├── setting
│ │ │ │ ├── night.proto
│ │ │ │ ├── internaldevice.proto
│ │ │ │ ├── download.proto
│ │ │ │ ├── dynamic.proto
│ │ │ │ ├── search.proto
│ │ │ │ ├── privacy.proto
│ │ │ │ ├── other.proto
│ │ │ │ ├── pegasus.proto
│ │ │ │ ├── experimental.proto
│ │ │ │ └── play.proto
│ │ │ └── v1
│ │ │ │ └── distribution.proto
│ │ ├── archive
│ │ │ └── middleware
│ │ │ │ └── v1
│ │ │ │ └── preload.proto
│ │ ├── playerunite
│ │ │ ├── pgcanymodel
│ │ │ │ └── pgcanymodel.proto
│ │ │ ├── ugcanymodel
│ │ │ │ └── ugcanymodel.proto
│ │ │ └── v1
│ │ │ │ └── playerunite.proto
│ │ ├── show
│ │ │ ├── gateway
│ │ │ │ └── v1
│ │ │ │ │ └── service.proto
│ │ │ ├── region
│ │ │ │ └── v1
│ │ │ │ │ └── region.proto
│ │ │ ├── mixture
│ │ │ │ └── v1
│ │ │ │ │ └── mixture.proto
│ │ │ ├── rank
│ │ │ │ └── v1
│ │ │ │ │ └── rank.proto
│ │ │ └── popular
│ │ │ │ └── v1
│ │ │ │ └── popular.proto
│ │ ├── wall
│ │ │ └── v1
│ │ │ │ └── wall.proto
│ │ ├── card
│ │ │ └── v1
│ │ │ │ ├── card.proto
│ │ │ │ └── ad.proto
│ │ ├── resource
│ │ │ ├── privacy
│ │ │ │ └── v1
│ │ │ │ │ └── api.proto
│ │ │ └── v1
│ │ │ │ └── module.proto
│ │ ├── playeronline
│ │ │ └── v1
│ │ │ │ └── playeronline.proto
│ │ ├── space
│ │ │ └── v1
│ │ │ │ └── space.proto
│ │ ├── interfaces
│ │ │ └── v1
│ │ │ │ └── space.proto
│ │ ├── click
│ │ │ └── v1
│ │ │ │ └── heartbeat.proto
│ │ └── splash
│ │ │ └── v1
│ │ │ └── splash.proto
│ ├── polymer
│ │ ├── demo
│ │ │ └── demo.proto
│ │ ├── list
│ │ │ └── list.proto
│ │ ├── contract
│ │ │ └── contract.proto
│ │ └── community
│ │ │ └── govern
│ │ │ └── v1
│ │ │ └── govern.proto
│ ├── metadata
│ │ ├── parabox
│ │ │ └── pararbox.proto
│ │ ├── fawkes
│ │ │ └── fawkes.proto
│ │ ├── metadata.proto
│ │ ├── restriction
│ │ │ └── restriction.proto
│ │ ├── network
│ │ │ └── network.proto
│ │ ├── locale
│ │ │ └── locale.proto
│ │ └── device
│ │ │ └── device.proto
│ ├── render
│ │ └── render.proto
│ ├── rpc
│ │ └── status.proto
│ ├── im
│ │ └── interfaces
│ │ │ └── inner-interface
│ │ │ └── v1
│ │ │ └── api.proto
│ ├── pagination
│ │ └── pagination.proto
│ ├── vega
│ │ └── deneb
│ │ │ └── v1
│ │ │ └── deneb.proto
│ ├── pgc
│ │ ├── service
│ │ │ └── premiere
│ │ │ │ └── v1
│ │ │ │ └── premiere.proto
│ │ └── gateway
│ │ │ └── player
│ │ │ └── v3
│ │ │ └── playurl.proto
│ ├── live
│ │ ├── app
│ │ │ └── room
│ │ │ │ └── v1
│ │ │ │ └── room.proto
│ │ └── general
│ │ │ └── interfaces
│ │ │ └── v1
│ │ │ └── interfaces.proto
│ ├── main
│ │ └── common
│ │ │ └── arch
│ │ │ └── doll
│ │ │ └── v1
│ │ │ └── doll.proto
│ ├── account
│ │ └── fission
│ │ │ └── v1
│ │ │ └── fission.proto
│ ├── api
│ │ └── player
│ │ │ └── v1
│ │ │ └── player.proto
│ ├── gaia
│ │ └── gw
│ │ │ └── gw_api.proto
│ └── cheese
│ │ └── gateway
│ │ └── player
│ │ └── v1
│ │ └── playurl.proto
├── pgc
│ ├── biz
│ │ └── room.proto
│ └── gateway
│ │ └── vega
│ │ └── v1
│ │ └── vega.proto
└── readme.md
├── .vuepress
├── theme
│ ├── index.js
│ └── layouts
│ │ └── Layout.vue
├── public
│ └── logo2.jpg
└── config.js
├── assets
├── img
│ ├── akari.jpg
│ ├── ban.png
│ ├── logo.png
│ ├── logo2.jpg
│ ├── history.png
│ ├── loadTV.gif
│ ├── toview.png
│ ├── 2233login.png
│ ├── ploading.gif
│ ├── sponsorQR.jpg
│ ├── battery-100.png
│ ├── ranking.svg
│ ├── sub.svg
│ ├── like.svg
│ ├── share.svg
│ ├── home.svg
│ ├── channel.svg
│ ├── fav.svg
│ ├── video_up.svg
│ ├── comment.svg
│ ├── coin.svg
│ ├── download.svg
│ ├── class.svg
│ ├── tebietuijian.svg
│ ├── add.svg
│ ├── activit.svg
│ ├── collect.svg
│ ├── delete.svg
│ ├── read.svg
│ ├── live.svg
│ ├── relation.svg
│ ├── topic.svg
│ ├── tuiguang.svg
│ ├── blackroom.svg
│ ├── follow.svg
│ └── musicplus.svg
└── zone_icon
│ ├── game.svg
│ ├── dance.svg
│ ├── tech.svg
│ ├── guochuang.svg
│ ├── life.svg
│ ├── digital.svg
│ ├── movie.svg
│ ├── anime.svg
│ ├── sports.svg
│ ├── ad.svg
│ ├── music.svg
│ ├── teleplay.svg
│ ├── fashion.svg
│ ├── information.svg
│ ├── knowledge.svg
│ ├── kichiku.svg
│ ├── car.svg
│ ├── cinephile.svg
│ ├── comic.svg
│ ├── douga.svg
│ ├── ent.svg
│ └── food.svg
├── .gitignore
├── package.json
├── .github
├── workflows
│ └── vuepress-deploy.yml
└── FUNDING.yml
└── docs
├── other
├── time_stamp.md
├── picture.md
└── errcode.md
├── audio
└── status_number.md
├── message
└── msg.md
├── vip
├── clockin.md
└── action.md
├── clientinfo
├── ip.md
└── client_info.md
├── article
└── category.md
├── danmaku
└── snapshot.md
├── manga
└── Activity.md
├── login
├── exit.md
├── login_notice.md
└── login_action
│ └── readme.md
├── video
└── pbp.md
├── dynamic
└── action.md
├── web_widget
└── zone_upload.md
├── user
├── check_nickname.md
├── register.md
└── contract.md
├── bangumi
└── follow.md
└── emoji
└── action.md
/grpc_api/bilibili/relation/interfaces/api.proto:
--------------------------------------------------------------------------------
1 | // TODO
--------------------------------------------------------------------------------
/grpc_api/bilibili/dagw/component/avatar/v1/avatar.proto:
--------------------------------------------------------------------------------
1 | // TODO
--------------------------------------------------------------------------------
/grpc_api/bilibili/dynamic/interfaces/campus/v1/api.proto:
--------------------------------------------------------------------------------
1 | // TODO
--------------------------------------------------------------------------------
/grpc_api/bilibili/dagw/component/avatar/common/common.proto:
--------------------------------------------------------------------------------
1 | // TODO
--------------------------------------------------------------------------------
/grpc_api/bilibili/community/interfacess/biligram/v1/biligram.proto:
--------------------------------------------------------------------------------
1 | // TODO
--------------------------------------------------------------------------------
/grpc_api/bilibili/pangu/gallery/v1/openplatform/apiserver/v1alpha1/api.proto:
--------------------------------------------------------------------------------
1 | // TODO
--------------------------------------------------------------------------------
/.vuepress/theme/index.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | extend: '@vuepress/theme-default'
3 | }
--------------------------------------------------------------------------------
/assets/img/akari.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClydeTime/bilibili-API-collect/master/assets/img/akari.jpg
--------------------------------------------------------------------------------
/assets/img/ban.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClydeTime/bilibili-API-collect/master/assets/img/ban.png
--------------------------------------------------------------------------------
/assets/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClydeTime/bilibili-API-collect/master/assets/img/logo.png
--------------------------------------------------------------------------------
/assets/img/logo2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClydeTime/bilibili-API-collect/master/assets/img/logo2.jpg
--------------------------------------------------------------------------------
/assets/img/history.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClydeTime/bilibili-API-collect/master/assets/img/history.png
--------------------------------------------------------------------------------
/assets/img/loadTV.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClydeTime/bilibili-API-collect/master/assets/img/loadTV.gif
--------------------------------------------------------------------------------
/assets/img/toview.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClydeTime/bilibili-API-collect/master/assets/img/toview.png
--------------------------------------------------------------------------------
/assets/img/2233login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClydeTime/bilibili-API-collect/master/assets/img/2233login.png
--------------------------------------------------------------------------------
/assets/img/ploading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClydeTime/bilibili-API-collect/master/assets/img/ploading.gif
--------------------------------------------------------------------------------
/assets/img/sponsorQR.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClydeTime/bilibili-API-collect/master/assets/img/sponsorQR.jpg
--------------------------------------------------------------------------------
/.vuepress/public/logo2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClydeTime/bilibili-API-collect/master/.vuepress/public/logo2.jpg
--------------------------------------------------------------------------------
/assets/img/battery-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ClydeTime/bilibili-API-collect/master/assets/img/battery-100.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | mkdocs/html/
2 | /.vuepress/.cache/
3 | /.vuepress/.temp/
4 | /.vuepress/dist/
5 | /node_modules/
6 | .idea/
7 | .vscode/
--------------------------------------------------------------------------------
/grpc_api/pgc/biz/room.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package pgc.biz;
4 |
5 | //
6 | message RoomProto {
7 | //
8 | repeated string room_id = 1;
9 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/message/esports/notify.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.message.esports;
4 |
5 | message Notify {
6 | // cid
7 | int64 cid = 1;
8 | }
9 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/viewunite/ugcanymodel.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.viewunite.ugcanymodel;
4 |
5 | //
6 | message ViewUgcAny {
7 |
8 | }
9 |
10 | //
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/message/note/sync.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.message.note;
4 |
5 | //
6 | message Sync {
7 | // 笔记id
8 | int64 note_id = 1;
9 | // 唯一标示
10 | string hash = 2;
11 | }
12 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/viewunite/pgcanymodel.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.viewunite.pgcanymodel;
4 |
5 | //
6 | message ViewPgcAny {
7 | //
8 | uint64 season_id = 1;
9 | //
10 | int32 season_type = 2;
11 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/polymer/demo/demo.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.polymer.demo;
4 |
5 | //
6 | message HelloWorldReq {
7 | //
8 | string content = 1;
9 | }
10 |
11 | //
12 | message HelloWorldResp {
13 | //
14 | string data = 1;
15 | }
16 |
--------------------------------------------------------------------------------
/assets/img/ranking.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/metadata/parabox/pararbox.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.metadata.parabox;
4 |
5 | //
6 | message Exp {
7 | //
8 | int64 id = 1;
9 | //
10 | int32 bucket = 2;
11 | }
12 |
13 | //
14 | message Exps {
15 | //
16 | repeated Exp exps = 1;
17 | }
--------------------------------------------------------------------------------
/assets/img/sub.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/distribution/setting/night.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.distribution.setting.night;
4 |
5 | import "bilibili/app/distribution/v1/distribution.proto";
6 |
7 | //
8 | message NightSettingsConfig {
9 | //
10 | bilibili.app.distribution.v1.BoolValue is_night_follow_system = 1;
11 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/distribution/setting/internaldevice.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.distribution.setting.internaldevice;
4 |
5 | import "bilibili/app/distribution/v1/distribution.proto";
6 |
7 | //
8 | message InternalDeviceConfig {
9 | // 首次启动时间
10 | bilibili.app.distribution.v1.Int64Value fts = 1;
11 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/distribution/setting/download.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.distribution.setting.download;
4 |
5 | import "bilibili/app/distribution/v1/distribution.proto";
6 |
7 | //
8 | message DownloadSettingsConfig {
9 | //
10 | bilibili.app.distribution.v1.BoolValue enable_download_auto_start = 1;
11 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/render/render.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.render;
4 |
5 | import "google/protobuf/any.proto";
6 |
7 | //
8 | message Render {
9 | //
10 | int64 code = 1;
11 | //
12 | string message = 2;
13 | //
14 | string ttl = 3;
15 | //
16 | google.protobuf.Any data = 4;
17 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/rpc/status.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.rpc;
4 |
5 | import "google/protobuf/any.proto";
6 |
7 | // 响应gRPC Status
8 | // 当status code是[UNKNOWN = 2]时,details为业务详细的错误信息,进行proto any转换成业务码结构体
9 | message Status {
10 | // 业务错误码
11 | int32 code = 1;
12 | // 业务错误信息
13 | string message = 2;
14 | // 扩展信息嵌套(相当于该messasge的套娃)
15 | repeated google.protobuf.Any details = 3;
16 | }
17 |
--------------------------------------------------------------------------------
/assets/img/like.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/assets/img/share.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/message/fission/notify.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.message.fission;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | //
8 | service Fission {
9 | //
10 | rpc GameNotify(google.protobuf.Empty) returns (stream GameNotifyReply);
11 | }
12 |
13 | message GameNotifyReply {
14 | // 类型字段
15 | uint32 type = 1;
16 | // 数据字段
17 | string data = 2;
18 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/message/ticket/activitygame.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.message.ticket;
4 |
5 | //
6 | enum RoomStatus {
7 | // 暂停:
8 | Pause = 0;
9 | // 播放:
10 | Play = 1;
11 | // 终止:
12 | End = 2;
13 | }
14 |
15 | // 推送选项
16 | message RoomEvent {
17 | // RoomStatus 类型
18 | RoomStatus room_status = 1;
19 | //
20 | string room_message = 2;
21 | }
22 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/archive/middleware/v1/preload.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.archive.middleware.v1;
4 |
5 | // 视频秒开参数
6 | message PlayerArgs {
7 | // 清晰度
8 | int64 qn = 1;
9 | // 流版本
10 | int64 fnver = 2;
11 | // 流类型
12 | int64 fnval = 3;
13 | // 返回url是否强制使用域名
14 | // 0:不强制使用域名 1:http域名 2:https域名
15 | int64 force_host = 4;
16 | // 音量均衡
17 | int64 voice_balance = 5;
18 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/distribution/setting/dynamic.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.distribution.setting.dynamic;
4 |
5 | import "bilibili/app/distribution/v1/distribution.proto";
6 |
7 | //
8 | message DynamicAutoPlay {
9 | //
10 | bilibili.app.distribution.v1.Int64Value value = 1;
11 | }
12 |
13 | //
14 | message DynamicDeviceConfig {
15 | //
16 | DynamicAutoPlay auto_play = 1;
17 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/v1/laser.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.v1;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | // Laser
8 | service Laser {
9 | // 监听上报事件
10 | rpc WatchLogUploadEvent(google.protobuf.Empty) returns (stream LaserLogUploadResp);
11 | }
12 |
13 | // 服务端下发日志上报事件
14 | message LaserLogUploadResp {
15 | // 任务id
16 | int64 taskid = 1;
17 | // 下发时间
18 | string date = 2;
19 | }
20 |
--------------------------------------------------------------------------------
/assets/img/home.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/metadata/fawkes/fawkes.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.metadata.fawkes;
4 |
5 | //
6 | message FawkesReply {
7 | // 客户端在fawkes系统中对应的已发布最新的config版本号
8 | string config = 1;
9 | // 客户端在fawkes系统中对应的已发布最新的ff版本号
10 | string ff = 2;
11 | }
12 |
13 | //
14 | message FawkesReq {
15 | // 客户端在fawkes系统的唯一名
16 | string appkey = 1;
17 | // 客户端在fawkes系统中的环境参数
18 | string env = 2;
19 | // 启动id
20 | string session_id = 3;
21 | }
22 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/v2/laser.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.v2;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | // Laser
8 | service Laser {
9 | // 监听Laser事件
10 | rpc WatchEvent(google.protobuf.Empty) returns (stream LaserEventResp);
11 | }
12 |
13 | // 服务端下发Laser事件
14 | message LaserEventResp {
15 | // 任务id
16 | int64 taskid = 1;
17 | // 指令名
18 | string action = 2;
19 | // 指令参数json字符串
20 | string params = 3;
21 | }
22 |
--------------------------------------------------------------------------------
/assets/img/channel.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/assets/img/fav.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/metadata/metadata.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.metadata;
4 |
5 | // 请求元数据
6 | // gRPC头部:x-bili-metadata-bin
7 | message Metadata {
8 | // 登录Token
9 | string access_key = 1;
10 | // 包类型
11 | string mobi_app = 2;
12 | // 运行设备
13 | string device = 3;
14 | // 构建id
15 | int32 build = 4;
16 | // APP分发渠道
17 | string channel = 5;
18 | // 设备buvid
19 | string buvid = 6;
20 | // 平台类型
21 | string platform = 7;
22 | }
23 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bilibili-api-collect",
3 | "version": "0.0.1",
4 | "repository": "https://github.com/SocialSisterYi/bilibili-API-collect.git",
5 | "author": "SocialSisterYi <1440239038@qq.com>",
6 | "license": "CC-BY-NC-4.0",
7 | "dependencies": {
8 | "@vuepress/plugin-back-to-top": "^1.9.8",
9 | "markdown-it-task-lists": "^2.1.1",
10 | "vuepress": "^1.9.8"
11 | },
12 | "scripts": {
13 | "dev": "vuepress dev",
14 | "build": "vuepress build"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/assets/img/video_up.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/distribution/setting/search.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.distribution.setting.search;
4 |
5 | import "bilibili/app/distribution/v1/distribution.proto";
6 |
7 | //
8 | message SearchAutoPlay {
9 | //
10 | bilibili.app.distribution.v1.Int64Value value = 1;
11 | //
12 | bilibili.app.distribution.v1.BoolValue affected_by_server_side = 2;
13 | }
14 |
15 | //
16 | message SearchDeviceConfig {
17 | //
18 | SearchAutoPlay auto_play = 1;
19 | }
--------------------------------------------------------------------------------
/.github/workflows/vuepress-deploy.yml:
--------------------------------------------------------------------------------
1 | name: deploy and pubish
2 | on: [push]
3 | jobs:
4 | build-and-deploy:
5 | runs-on: ubuntu-latest
6 | steps:
7 | - name: Checkout
8 | uses: actions/checkout@master
9 |
10 | - name: vuepress-deploy
11 | uses: jenkey2011/vuepress-deploy@master
12 | env:
13 | ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
14 | TARGET_REPO: SocialSisterYi/bilibili-API-collect
15 | TARGET_BRANCH: gh_pages
16 | BUILD_SCRIPT: yarn && yarn build
17 | BUILD_DIR: .vuepress/dist/
18 |
--------------------------------------------------------------------------------
/grpc_api/readme.md:
--------------------------------------------------------------------------------
1 | # grpc接口定义(protobuf结构体)
2 |
3 | 注:
4 |
5 | 1. proto结构体文件按照包名分类,同级放在同一目录中
6 |
7 | 2. 暂时无说明文档,稍后添加
8 |
9 | 3. 以下文件全部来自apk的逆向工程,如有疏漏请包涵
10 |
11 | ## grpc主机
12 |
13 | B站客户端的grpc接口主机为以下服务器
14 |
15 | > grpc.biliapi.net
16 | >
17 | > app.bilibili.com
18 |
19 | ## grpc鉴权
20 |
21 | 需要在请求http头部中添加`access_key`,如下
22 |
23 | ```
24 | authorization:identify_v1 {access_key}
25 | ```
26 |
27 | ## grpc头部
28 |
29 | - [bilibili.metadata](bilibili/metadata):客户端环境参数
30 | - [bilibili.rpc](bilibili/rpc/status.proto):响应错误信息
31 |
32 | ## 接口请求定义
33 |
34 | *稍后补充*
--------------------------------------------------------------------------------
/assets/img/comment.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/metadata/restriction/restriction.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.metadata.restriction;
4 |
5 | // 模式类型
6 | enum ModeType {
7 | NORMAL = 0; // 正常模式
8 | TEENAGERS = 1; // 青少年模式
9 | LESSONS = 2; // 课堂模式
10 | }
11 |
12 | // 限制条件
13 | message Restriction {
14 | // 青少年模式开关状态
15 | bool teenagers_mode = 1;
16 | // 课堂模式开关状态
17 | bool lessons_mode = 2;
18 | // 模式类型(旧版)
19 | ModeType mode = 3;
20 | // app 审核review状态
21 | bool review = 4;
22 | // 客户端是否选择关闭个性化推荐
23 | bool disable_rcmd = 5;
24 | }
25 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/distribution/setting/privacy.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.distribution.setting.privacy;
4 |
5 | import "bilibili/app/distribution/v1/distribution.proto";
6 |
7 | //
8 | message MidPrivacySettingsConfig {
9 | //
10 | bilibili.app.distribution.v1.BoolValue recommend_to_known = 1;
11 | }
12 |
13 | //
14 | message PrivacySettingsConfig {
15 | //
16 | bilibili.app.distribution.v1.BoolValue ad_recommand_store = 1;
17 | // 传感器权限
18 | bilibili.app.distribution.v1.BoolValue sensor_access = 2;
19 |
20 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/playerunite/pgcanymodel/pgcanymodel.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.playerunite.pgcanymodel;
4 |
5 | import "bilibili/pgc/gateway/player/v2/playurl.proto";
6 |
7 | message PGCAnyModel {
8 | bilibili.pgc.gateway.player.v2.PlayViewBusinessInfo business = 3;
9 | bilibili.pgc.gateway.player.v2.Event event = 4;
10 | bilibili.pgc.gateway.player.v2.ViewInfo view_info = 5;
11 | bilibili.pgc.gateway.player.v2.PlayAbilityExtConf play_ext_conf = 6;
12 | bilibili.pgc.gateway.player.v2.PlayExtInfo play_ext_info = 7;
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/v1/mod.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.v1;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | // ModManager
8 | service ModManager {
9 | //
10 | rpc WatchResource(google.protobuf.Empty) returns (stream ModResourceResp);
11 | }
12 |
13 | //
14 | message ModResourceResp {
15 | //
16 | int32 atcion = 1;
17 | //
18 | string app_key = 2;
19 | //
20 | string pool_name = 3;
21 | //
22 | string module_name = 4;
23 | //
24 | int64 module_version = 5;
25 | //
26 | int64 list_version = 6;
27 | }
28 |
--------------------------------------------------------------------------------
/assets/img/coin.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/assets/zone_icon/game.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/img/download.svg:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/show/gateway/v1/service.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.show.gateway.v1;
4 |
5 | import "bilibili/broadcast/message/main/native.proto";
6 |
7 | //
8 | service AppShow {
9 | // 获取Native页进度数据
10 | rpc GetActProgress (GetActProgressReq) returns (GetActProgressReply);
11 | }
12 |
13 | // 获取Native页进度数据-请求
14 | message GetActProgressReq {
15 | // Native页id
16 | int64 pageID = 1;
17 | // 用户mid
18 | int64 mid = 2;
19 | }
20 |
21 | // 获取Native页进度数据-响应
22 | message GetActProgressReply {
23 | // 进度数据
24 | bilibili.broadcast.message.main.NativePageEvent event = 1;
25 | }
--------------------------------------------------------------------------------
/.vuepress/theme/layouts/Layout.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/playerunite/ugcanymodel/ugcanymodel.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.playerunite.ugcanymodel;
4 |
5 | message ButtonStyle {
6 | string text = 1;
7 | string text_color = 2;
8 | string bg_color = 3;
9 | string jump_link = 4;
10 | }
11 |
12 | enum PlayLimitCode {
13 | PLC_UNKNOWN = 0;
14 | PLC_NOTPAYED = 1;
15 | }
16 |
17 | message PlayLimit {
18 | PlayLimitCode code = 1;
19 | string message = 2;
20 | string sub_message = 3;
21 | ButtonStyle button = 4;
22 | }
23 |
24 | message UGCAnyModel {
25 | PlayLimit play_limit = 1;
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/assets/img/class.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [SocialSisterYi]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: https://afdian.net/@ShakaiAneE
13 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/im/interfaces/inner-interface/v1/api.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.im.interface.inner.interface.v1;
4 |
5 | //
6 | service InnerInterface {
7 | //
8 | rpc UpdateListInn(ReqOpBlacklist) returns(RspOpBlacklist);
9 | }
10 |
11 | //
12 | message BanUser {
13 | // 用户mid
14 | uint64 uid = 1;
15 | // 封禁业务
16 | int32 limit = 2;
17 | // 封禁时间
18 | int32 time = 3;
19 | // 模式
20 | // 1:add 2:remove
21 | int32 mode = 4;
22 | }
23 |
24 | //
25 | message ReqOpBlacklist {
26 | // 需要封禁/解封的用户信息
27 | repeated BanUser ban_users = 1;
28 | }
29 |
30 | //
31 | message RspOpBlacklist {
32 | //
33 | repeated uint64 failed_users = 1;
34 | }
35 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/pagination/pagination.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.pagination;
4 |
5 | // 分页信息
6 | message FeedPagination {
7 | //
8 | int32 page_size = 1;
9 | //
10 | string offset = 2;
11 | //
12 | bool is_refresh = 3;
13 | }
14 |
15 | // 分页信息
16 | message FeedPaginationReply {
17 | //
18 | string next_offset = 1;
19 | //
20 | string prev_offset = 2;
21 | //
22 | string last_read_offset = 3;
23 | }
24 |
25 | // 分页信息
26 | message Pagination {
27 | //
28 | int32 page_size = 1;
29 | //
30 | string next = 2;
31 | }
32 |
33 | // 分页信息
34 | message PaginationReply {
35 | //
36 | string next = 1;
37 | //
38 | string prev = 2;
39 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/message/editor/notify.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.message.editor;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | //
8 | service OperationNotify {
9 | //
10 | rpc OperationNotify(google.protobuf.Empty) returns (stream Notify);
11 | }
12 |
13 | message Notify {
14 | // 消息唯一标示
15 | int64 msg_id = 1;
16 | // 消息类型
17 | int32 msg_type = 2;
18 | // 接收方uid
19 | int64 receiver_uid = 3;
20 | //接收方类型
21 | int32 receiver_type = 4;
22 | // 故事的版本
23 | int64 story_version = 5;
24 | // 操作结果的hash值
25 | int64 op_hash = 6;
26 | // 操作产生用户的uid
27 | int64 op_sender = 7;
28 | // patch内容
29 | string op_content = 8;
30 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/vega/deneb/v1/deneb.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.vega.deneb.v1;
4 |
5 | import "google/protobuf/any.proto";
6 |
7 | //
8 | service VegaDenebRPC {
9 | //
10 | rpc MessagePulls (MessagePullsReq) returns (MessagePullsReply);
11 | }
12 |
13 | //
14 | message MessagePullsReply {
15 | //
16 | repeated google.protobuf.Any data = 1;
17 | //
18 | int32 pn = 2;
19 | //
20 | int32 ps = 3;
21 | //
22 | int64 count = 4;
23 | //
24 | bool has_next = 5;
25 | }
26 |
27 | //
28 | message MessagePullsReq {
29 | //
30 | int64 start_seq_id = 1;
31 | //
32 | int64 end_seq_id = 2;
33 | //
34 | int32 pn = 3;
35 | //
36 | int32 ps = 4;
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/community/service/govern/v1/govern.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.community.service.govern.v1;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | //
8 | service Qoe {
9 | //
10 | rpc QoeReport (QoeReportReq) returns (google.protobuf.Empty);
11 | }
12 |
13 | //
14 | message QoeReportReq {
15 | //
16 | int64 id = 1;
17 | //
18 | int64 scene = 2;
19 | //
20 | int32 type = 3;
21 | //
22 | bool cancel = 4;
23 | //
24 | string business_type = 5;
25 | //
26 | int64 oid = 6;
27 | //
28 | QoeScoreResult score_result = 7;
29 | //
30 | string business_data = 8;
31 | }
32 |
33 | //
34 | message QoeScoreResult {
35 | //
36 | float score = 1;
37 | }
--------------------------------------------------------------------------------
/assets/img/tebietuijian.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/message/main/native.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.message.main;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | //
8 | service NativePage {
9 | //
10 | rpc WatchNotify(google.protobuf.Empty) returns (stream NativePageEvent);
11 | }
12 |
13 | //
14 | message NativePageEvent {
15 | // Native页ID
16 | int64 PageID = 1;
17 | //
18 | repeated EventItem Items = 2;
19 | }
20 |
21 | //
22 | message EventItem {
23 | // 组件标识
24 | int64 ItemID = 1;
25 | // 组件类型
26 | string Type = 2;
27 | // 进度条数值
28 | int64 Num = 3;
29 | // 进度条展示数值
30 | string DisplayNum = 4;
31 | // h5的组件标识
32 | string WebKey = 5;
33 | // 活动统计维度
34 | // 0:用户维度 1:规则维度
35 | int64 dimension = 6;
36 | }
37 |
--------------------------------------------------------------------------------
/assets/img/add.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
21 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/metadata/network/network.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.metadata.network;
4 |
5 | // 网络类型标识
6 | // gRPC头部:x-bili-network-bin
7 | message Network {
8 | // 网络类型
9 | NetworkType type = 1;
10 | // 免流类型
11 | TFType tf = 2;
12 | // 运营商
13 | string oid = 3;
14 | }
15 |
16 | // 网络类型
17 | enum NetworkType {
18 | NT_UNKNOWN = 0; // 未知
19 | WIFI = 1; // WIFI
20 | CELLULAR = 2; // 蜂窝网络
21 | OFFLINE = 3; // 未连接
22 | OTHERNET = 4; // 其他网络
23 | ETHERNET = 5; // 以太网
24 | }
25 |
26 | // 免流类型
27 | enum TFType {
28 | TF_UNKNOWN = 0; // 正常计费
29 | U_CARD = 1; // 联通卡
30 | U_PKG = 2; // 联通包
31 | C_CARD = 3; // 移动卡
32 | C_PKG = 4; // 移动包
33 | T_CARD = 5; // 电信卡
34 | T_PKG = 6; // 电信包
35 | }
36 |
--------------------------------------------------------------------------------
/assets/zone_icon/dance.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/pgc/service/premiere/v1/premiere.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.pgc.service.premiere.v1;
4 |
5 | // 首播服务
6 | service Premiere {
7 | // 获取首播状态
8 | rpc Status (PremiereStatusReq) returns (PremiereStatusReply);
9 | }
10 |
11 | // 获取首播状态-请求
12 | message PremiereStatusReq {
13 | // 剧集epid
14 | int64 ep_id = 1;
15 | }
16 |
17 | // 获取首播状态-响应
18 | message PremiereStatusReply {
19 | // 服务端播放进度 单位ms 用户实际播放进度:progress - delay_time
20 | int64 progress = 1;
21 | // 起播时间戳 单位ms
22 | int64 start_time = 2;
23 | // 延迟播放时长 单位ms
24 | int64 delay_time = 3;
25 | // 首播在线人数
26 | int64 online_count = 4;
27 | // 首播状态
28 | // 1:预热 2:首播中 3:紧急停播 4:已结束
29 | int32 status = 5;
30 | // 首播结束后跳转类型
31 | // 1:下架 2:转点播
32 | int32 after_premiere_type = 6;
33 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/polymer/list/list.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.polymer.list;
4 |
5 | //
6 | service List {
7 | //
8 | rpc FavoriteTab(FavoriteTabReq) returns (FavoriteTabReply);
9 | //
10 | rpc CheckAccount(CheckAccountReq) returns (CheckAccountReply);
11 | }
12 |
13 | //
14 | message CheckAccountReply {
15 | //
16 | bool is_new = 1;
17 | }
18 |
19 | //
20 | message CheckAccountReq {
21 | //
22 | int64 uid = 1;
23 | //
24 | string periods = 2;
25 | }
26 |
27 | //
28 | message FavoriteTabItem {
29 | //
30 | string name = 1;
31 | //
32 | string uri = 2;
33 | //
34 | string type = 3;
35 | }
36 |
37 | //
38 | message FavoriteTabReply {
39 | //
40 | repeated FavoriteTabItem items = 1;
41 | }
42 |
43 | //
44 | message FavoriteTabReq {}
45 |
--------------------------------------------------------------------------------
/assets/img/activit.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/img/collect.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/metadata/locale/locale.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.metadata.locale;
4 |
5 | // 区域标识
6 | // gRPC头部:x-bili-locale-bin
7 | message Locale {
8 | // App设置的locale
9 | LocaleIds c_locale = 1;
10 | // 系统默认的locale
11 | LocaleIds s_locale = 2;
12 | // sim卡的国家码+运营商码
13 | string sim_code = 3;
14 | // 时区
15 | string timezone = 4;
16 | }
17 |
18 | // Defined by https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html
19 | message LocaleIds {
20 | // A language designator is a code that represents a language.
21 | string language = 1;
22 | // Writing systems.
23 | string script = 2;
24 | // A region designator is a code that represents a country or an area.
25 | string region = 3;
26 | }
27 |
--------------------------------------------------------------------------------
/assets/img/delete.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/wall/v1/wall.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.wall.v1;
4 |
5 | // 免流规则
6 | service Wall {
7 | // 获取免流规则信息
8 | rpc RuleInfo (RuleRequest) returns (RulesReply);
9 | }
10 |
11 | // 免流规则信息
12 | message RuleInfo {
13 | // 是否支持免流
14 | bool tf = 1;
15 | // 操作模式
16 | // break:无 replace:替换 proxy:代理
17 | string m = 2;
18 | // 操作参数
19 | string a = 3;
20 | // 匹配目标正则
21 | string p = 4;
22 | //
23 | repeated string a_backup = 5;
24 | }
25 |
26 | // 获取免流规则信息-请求
27 | message RuleRequest {}
28 |
29 | // 免流规则信息组
30 | message RulesInfo {
31 | // 免流规则信息
32 | repeated RuleInfo rulesInfo = 1;
33 | }
34 |
35 | // 获取免流规则信息-响应
36 | message RulesReply {
37 | // 各ISP的免流规则信息组
38 | // ISP如: cu ct cm
39 | map rulesInfo = 1;
40 | //
41 | string hash_value = 2;
42 | }
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/assets/img/read.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/card/v1/card.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.card.v1;
4 |
5 | import "bilibili/app/card/v1/single.proto";
6 |
7 | // 卡片信息
8 | message Card {
9 | oneof item {
10 | // 小封面条目
11 | SmallCoverV5 small_cover_v5 = 1;
12 | //
13 | LargeCoverV1 large_cover_v1 = 2;
14 | //
15 | ThreeItemAllV2 three_item_all_v2 = 3;
16 | //
17 | ThreeItemV1 three_item_v1 = 4;
18 | //
19 | HotTopic hot_topic = 5;
20 | //
21 | DynamicHot three_item_h_v5 = 6;
22 | //
23 | MiddleCoverV3 middle_cover_v3 = 7;
24 | //
25 | LargeCoverV4 large_cover_v4 = 8;
26 | // 热门列表顶部按钮
27 | PopularTopEntrance popular_top_entrance = 9;
28 | //
29 | RcmdOneItem rcmd_one_item = 10;
30 | //
31 | SmallCoverV5Ad small_cover_v5_ad = 11;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/pgc/gateway/player/v3/playurl.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.pgc.gateway.player.v3;
4 |
5 | import "bilibili/playershared/playershared.proto";
6 |
7 | import "google/protobuf/any.proto";
8 |
9 | // 播放页信息-请求
10 | message PlayViewReq {
11 | // 视频信息
12 | bilibili.playershared.VideoVod vod = 1;
13 | // 当前页spm
14 | string spmid = 2;
15 | // 上一页spm
16 | string from_spmid = 3;
17 | // 青少年模式
18 | int32 teenagers_mode = 4;
19 | //
20 | map extra_content = 5;
21 |
22 | }
23 |
24 | // 播放页信息-响应
25 | message PlayViewReply {
26 | bilibili.playershared.VodInfo vod_info = 1;
27 | bilibili.playershared.PlayArcConf play_arc_conf = 2;
28 | google.protobuf.Any supplement = 3;
29 | bilibili.playershared.PlayArc play_arc = 4;
30 | bilibili.playershared.QnTrialInfo qn_trial_info = 5;
31 | bilibili.playershared.Event event = 6;
32 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/v1/test.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.v1;
4 |
5 | import "google/protobuf/any.proto";
6 | import "google/protobuf/empty.proto";
7 |
8 | // 服务端下发的测试专用消息,客户端debug/release包都会通过弹窗响应该消息
9 | // 后端平台 必须 限制该消息只能针对单个用户发送
10 |
11 | // Test
12 | service Test {
13 | // 监听上报事件
14 | rpc WatchTestEvent(google.protobuf.Empty) returns (stream TestResp);
15 | }
16 |
17 | //
18 | service Test2 {
19 | //
20 | rpc Test(AddParams) returns (google.protobuf.Empty);
21 | }
22 |
23 | //
24 | message AddParams {
25 | //
26 | int32 a = 1;
27 | //
28 | int32 b = 2;
29 | }
30 |
31 | //
32 | message AddResult {
33 | //
34 | int32 r = 1;
35 | }
36 |
37 | message TestResp {
38 | // 任务id
39 | int64 taskid = 1;
40 | // 时间戳
41 | int64 timestamp = 2;
42 | // 消息
43 | string message = 3;
44 | // 扩展
45 | google.protobuf.Any extra = 4;
46 | }
47 |
--------------------------------------------------------------------------------
/assets/img/live.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/zone_icon/tech.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/distribution/setting/other.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.distribution.setting.other;
4 |
5 | import "bilibili/app/distribution/v1/distribution.proto";
6 |
7 | //
8 | message OtherSettingsConfig {
9 | //
10 | bilibili.app.distribution.v1.Int64Value watermark_type = 1;
11 | //
12 | bilibili.app.distribution.v1.Int64Value web_image_quality_type = 2;
13 | //
14 | bilibili.app.distribution.v1.BoolValue enable_read_pasteboard = 3;
15 | //
16 | bilibili.app.distribution.v1.BoolValue paste_auto_jump = 4;
17 | //
18 | bilibili.app.distribution.v1.BoolValue mini_screen_play_when_back = 5;
19 | //
20 | bilibili.app.distribution.v1.BoolValue enable_resume_playing = 6;
21 | //
22 | bilibili.app.distribution.v1.BoolValue enable_wifi_auto_update = 7;
23 | //
24 | bilibili.app.distribution.v1.BoolValue enable_guide_screenshot_share = 8;
25 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/message/ogv/live.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.message.ogv;
4 |
5 | // 开播事件
6 | message LiveStartEvent {}
7 |
8 | // 直播中止事件
9 | message LiveEndEvent {}
10 |
11 | // 在线人数事件
12 | message LiveOnlineEvent {
13 | //在线人数
14 | int64 online = 1;
15 | }
16 |
17 | // 变更通知
18 | message LiveUpdateEvent {
19 | // 直播后状态
20 | // 1:下线 2:转点播
21 | int32 after_premiere_type = 1;
22 | // 直播开始绝对时间 单位ms
23 | int64 start_time = 2;
24 | // id
25 | string id = 3;
26 | // 服务端播放进度,未打散,负数表示距离开播时间,正数表示已开播时间,单位:毫秒
27 | // 用户实际播放进度:progress - delay_time
28 | int64 progress = 4;
29 | }
30 |
31 | // 直播间事件
32 | message CMDBody {
33 | //命令类型
34 | oneof event {
35 | // 开播事件
36 | LiveStartEvent start = 1;
37 | // 直播中止事件
38 | LiveEndEvent emergency = 2;
39 | // 在线人数事件
40 | LiveOnlineEvent online = 3;
41 | // 变更通知
42 | LiveUpdateEvent update = 4;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/assets/img/relation.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/show/region/v1/region.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.show.region.v1;
4 |
5 | //
6 | service Region {
7 | //
8 | rpc Region (RegionReq) returns (RegionReply);
9 | }
10 |
11 | //
12 | message RegionConfig {
13 | //
14 | string scenes_name = 1;
15 | //
16 | string scenes_type = 2;
17 | }
18 |
19 | //
20 | message RegionInfo {
21 | //
22 | int32 tid = 1;
23 | //
24 | int32 reid = 2;
25 | //
26 | string name = 3;
27 | //
28 | string logo = 4;
29 | //
30 | string goto = 5;
31 | //
32 | string param = 6;
33 | //
34 | string uri = 7;
35 | //
36 | int32 type = 8;
37 | //
38 | int32 is_bangumi = 9;
39 | //
40 | repeated RegionInfo children = 10;
41 | //
42 | repeated RegionConfig config = 11;
43 | }
44 |
45 | //
46 | message RegionReply {
47 | //
48 | repeated RegionInfo regions = 1;
49 | }
50 |
51 | //
52 | message RegionReq {
53 | //
54 | string lang = 1;
55 | }
56 |
--------------------------------------------------------------------------------
/assets/zone_icon/guochuang.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/show/mixture/v1/mixture.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.show.mixture.v1;
4 |
5 | //
6 | service Mixture {
7 | //
8 | rpc Widget(WidgetReq) returns (WidgetReply);
9 | }
10 |
11 | //
12 | message RcmdReason {
13 | //
14 | string content = 1;
15 | //
16 | uint32 corner_mark = 2;
17 | }
18 |
19 | //
20 | message WidgetItem {
21 | //
22 | string cover = 1;
23 | //
24 | string view = 2;
25 | //
26 | RcmdReason rcmd_reason = 3;
27 | //
28 | string title = 4;
29 | //
30 | string name = 5;
31 | //
32 | string uri = 6;
33 | //
34 | string goto = 7;
35 | //
36 | int64 id = 8;
37 | //
38 | int32 view_icon = 9;
39 | }
40 |
41 | //
42 | message WidgetReply {
43 | //
44 | repeated WidgetItem item = 1;
45 | }
46 |
47 | //
48 | message WidgetReq {
49 | //
50 | string from_spmid = 1;
51 | //
52 | uint32 page_no = 2;
53 | }
--------------------------------------------------------------------------------
/assets/zone_icon/life.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/metadata/device/device.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.metadata.device;
4 |
5 | // 设备信息
6 | // gRPC头部:x-bili-device-bin
7 | message Device {
8 | // 产品id
9 | // 粉 白 蓝 直播姬 HD 海外 OTT 漫画 TV野版 小视频 网易漫画 网易漫画 网易漫画HD 国际版 东南亚版
10 | // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 30
11 | int32 app_id = 1;
12 | // 构建id
13 | int32 build = 2;
14 | // 设备buvid
15 | string buvid = 3;
16 | // 包类型
17 | string mobi_app = 4;
18 | // 平台类型
19 | // ios android
20 | string platform = 5;
21 | // 设备类型
22 | string device = 6;
23 | // 渠道
24 | string channel = 7;
25 | // 手机品牌
26 | string brand = 8;
27 | // 手机型号
28 | string model = 9;
29 | // 系统版本
30 | string osver = 10;
31 | // 本地设备指纹
32 | string fp_local = 11;
33 | // 远程设备指纹
34 | string fp_remote = 12;
35 | // APP版本号
36 | string version_name = 13;
37 | // 设备指纹, 不区分本地或远程设备指纹,作为推送目标的索引
38 | string fp = 14;
39 | // 首次启动时的毫秒时间戳
40 | int64 fts = 15;
41 | }
42 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/live/app/room/v1/room.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.live.app.room.v1;
4 |
5 | //
6 | message GetStudioListReq {
7 | //
8 | int64 room_id = 1;
9 | }
10 |
11 | //
12 | message GetStudioListResp {
13 | //
14 | message Pendants {
15 | //
16 | Pendant frame = 1;
17 | //
18 | Pendant badge = 2;
19 | }
20 | //
21 | message Pendant {
22 | //
23 | string name = 1;
24 | //
25 | int64 position = 2;
26 | //
27 | string value = 3;
28 | //
29 | string desc = 4;
30 | }
31 | //
32 | message StudioMaster {
33 | //
34 | int64 uid = 1;
35 | //
36 | int64 room_id = 2;
37 | //
38 | string uname = 3;
39 | //
40 | string face = 4;
41 | //
42 | Pendants pendants = 5;
43 | //
44 | string tag = 6;
45 | //
46 | int64 tag_type = 7;
47 | }
48 | //
49 | int64 status = 1;
50 | //
51 | repeated StudioMaster master_list = 2;
52 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/main/common/arch/doll/v1/doll.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.main.common.arch.doll.v1;
4 |
5 | //
6 | service Echo {
7 | //
8 | rpc Ping(PingRequest) returns(PingResponse);
9 | //
10 | rpc Say(SayRequest) returns(SayResponse);
11 | //
12 | rpc Error(ErrorRequest) returns(ErrorResponse);
13 | }
14 |
15 | //
16 | message ErrorRequest {
17 | //
18 | int32 error = 2;
19 | //
20 | int64 time = 1;
21 | //
22 | int64 delay = 3;
23 | }
24 |
25 | //
26 | message ErrorResponse {
27 | //
28 | string host = 1;
29 | //
30 | int64 time = 3;
31 | }
32 |
33 | //
34 | message PingRequest {
35 | //
36 | int64 time = 1;
37 | }
38 |
39 | //
40 | message PingResponse {
41 | //
42 | string host = 1;
43 | //
44 | int64 time = 3;
45 | }
46 |
47 | //
48 | message SayRequest {
49 | //
50 | string content = 1;
51 | }
52 |
53 | //
54 | message SayResponse {
55 | //
56 | string host = 1;
57 | //
58 | string content = 2;
59 | //
60 | int64 time = 3;
61 | }
62 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/distribution/setting/pegasus.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.distribution.setting.pegasus;
4 |
5 | import "bilibili/app/distribution/v1/distribution.proto";
6 |
7 | //
8 | message FeedModeValue {
9 | //
10 | bilibili.app.distribution.v1.Int64Value value = 1;
11 | }
12 |
13 | //
14 | message PegasusAutoPlay {
15 | //
16 | bilibili.app.distribution.v1.Int64Value single = 1;
17 | //
18 | bilibili.app.distribution.v1.Int64Value double = 2;
19 | //
20 | bilibili.app.distribution.v1.BoolValue single_affected_by_server_side = 3;
21 | //
22 | bilibili.app.distribution.v1.BoolValue double_affected_by_server_side = 4;
23 | }
24 |
25 | //
26 | message PegasusColumnValue {
27 | //
28 | bilibili.app.distribution.v1.Int64Value value = 1;
29 | //
30 | bilibili.app.distribution.v1.BoolValue affected_by_server_side = 2;
31 | }
32 |
33 | //
34 | message PegasusDeviceConfig {
35 | //
36 | PegasusColumnValue column = 1;
37 | //
38 | FeedModeValue mode = 2;
39 | //
40 | PegasusAutoPlay auto_play = 3;
41 | }
--------------------------------------------------------------------------------
/assets/zone_icon/digital.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/img/topic.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.vuepress/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | base: "/bilibili-API-collect/",
3 | title: "BAC Document",
4 | description: "社区开源的第三方哔哩哔哩 API 文档",
5 | head: [
6 | ['link', { rel: 'icon', href: './logo2.jpg' }]
7 | ],
8 | locales: {
9 | '/': {
10 | lang: 'zh-CN',
11 | },
12 | },
13 | themeConfig: {
14 | logo: './logo2.jpg',
15 | nav: [
16 | {text: '首页', link: '/'},
17 | {text: '目录', link: '/#🍴目录'},
18 | {text: '贡献指南', link: '/CONTRIBUTING.html'},
19 | {
20 | text: '相关社群',
21 | items: [
22 | {text: 'QQ交流群', link: 'https://jq.qq.com/?_wv=1027&k=s1M0LCcu'},
23 | {text: 'Telegram交流群', link: 'https://t.me/bilibili_API_collect_community'}
24 | ]
25 | },
26 | {text: 'GitHub', link: 'https://github.com/SocialSisterYi/bilibili-API-collect'},
27 | ],
28 | sidebar: 'auto',
29 | smoothScroll: true
30 | },
31 | plugins: [
32 | '@vuepress/back-to-top',
33 | ],
34 | markdown: {
35 | lineNumbers: true,
36 | plugins: ['task-lists']
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/assets/zone_icon/movie.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/live/general/interfaces/v1/interfaces.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.live.general.interfaces.v1;
4 |
5 | //
6 | message GetOnlineRankReq {
7 | //
8 | int64 ruid = 1;
9 | //
10 | int64 room_id = 2;
11 | //
12 | int64 page = 3;
13 | //
14 | int64 page_size = 4;
15 | //
16 | string platform = 5;
17 | }
18 |
19 | //
20 | message GetOnlineRankResp {
21 | //
22 | message OnlineRankItem {
23 | //
24 | int64 uid = 1;
25 | //
26 | string uname = 2;
27 | //
28 | string face = 3;
29 | //
30 | int64 continue_watch = 4;
31 | //
32 | MedalInfo medal_info = 5;
33 | //
34 | int64 guard_level = 6;
35 | }
36 | //
37 | OnlineRankItem item = 1;
38 | //
39 | int64 online_num = 2;
40 | }
41 |
42 | //
43 | message MedalInfo {
44 | //
45 | int64 guard_level = 1;
46 | //
47 | int64 medal_color_start = 2;
48 | //
49 | int64 medal_color_end = 3;
50 | //
51 | int64 medal_color_border = 4;
52 | //
53 | string medal_name = 5;
54 | //
55 | int64 level = 6;
56 | //
57 | int64 target_id = 7;
58 | //
59 | int64 is_light = 8;
60 | }
61 |
--------------------------------------------------------------------------------
/assets/zone_icon/anime.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/card/v1/ad.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.card.v1;
4 |
5 | //
6 | message AdInfo {
7 | //
8 | int64 creative_id = 1;
9 | //
10 | int32 creative_type = 2;
11 | //
12 | int32 card_type = 3;
13 | //
14 | CreativeContent creative_content = 4;
15 | //
16 | string ad_cb = 5;
17 | //
18 | int64 resource = 6;
19 | //
20 | int32 source = 7;
21 | //
22 | string request_id = 8;
23 | //
24 | bool is_ad = 9;
25 | //
26 | int64 cm_mark = 10;
27 | //
28 | int32 index = 11;
29 | //
30 | bool is_ad_loc = 12;
31 | //
32 | int32 card_index = 13;
33 | //
34 | string client_ip = 14;
35 | //
36 | bytes extra = 15;
37 | //
38 | int32 creative_style = 16;
39 | }
40 |
41 | //
42 | message CreativeContent {
43 | //
44 | string title = 1;
45 | //
46 | string description = 2;
47 | //
48 | int64 video_id = 3;
49 | //
50 | string username = 4;
51 | //
52 | string image_url = 5;
53 | //
54 | string image_md5 = 6;
55 | //
56 | string log_url = 7;
57 | //
58 | string log_md5 = 8;
59 | //
60 | string url = 9;
61 | //
62 | string click_url = 10;
63 | //
64 | string show_url = 11;
65 | }
66 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/resource/privacy/v1/api.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.resource.privacy.v1;
4 |
5 | // 隐私
6 | service Privacy {
7 | // 获取隐私设置
8 | rpc PrivacyConfig(NoArgRequest) returns(PrivacyConfigReply);
9 | // 修改隐私设置
10 | rpc SetPrivacyConfig(SetPrivacyConfigRequest) returns(NoReply);
11 | }
12 |
13 | // 空请求
14 | message NoArgRequest{
15 |
16 | }
17 |
18 | // 空响应
19 | message NoReply{
20 |
21 | }
22 |
23 | // 隐私设置
24 | message PrivacyConfigItem {
25 | // 隐私开关类型
26 | PrivacyConfigType privacy_config_type = 1;
27 | //
28 | string title = 2;
29 | // 隐私开关状态
30 | PrivacyConfigState state = 3;
31 | //
32 | string sub_title = 4;
33 | //
34 | string sub_title_uri = 5;
35 | }
36 |
37 | // 获取隐私设置-响应
38 | message PrivacyConfigReply {
39 | // 隐私设置
40 | PrivacyConfigItem privacy_config_item = 1;
41 | }
42 |
43 | // 隐私开关状态
44 | enum PrivacyConfigState {
45 | close = 0; // 关闭
46 | open = 1; // 打开
47 | }
48 |
49 | // 隐私开关类型
50 | enum PrivacyConfigType {
51 | none = 0; //
52 | dynamic_city = 1; // 动态同城
53 | }
54 |
55 | // 修改隐私设置-请求
56 | message SetPrivacyConfigRequest {
57 | // 隐私开关类型
58 | PrivacyConfigType privacy_config_type = 1;
59 | // 隐私开关状态
60 | PrivacyConfigState state = 2;
61 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/account/fission/v1/fission.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.account.fission.v1;
4 |
5 | // Fission裂变
6 | service Fission {
7 | // 活动入口
8 | rpc Entrance (EntranceReq) returns (EntranceReply);
9 | // 首页弹窗
10 | rpc Window (WindowReq) returns (WindowReply);
11 | //
12 | rpc Privacy (PrivacyReq) returns (PrivacyReply);
13 | }
14 |
15 | // 动画效果
16 | message AnimateIcon {
17 | // icon文件
18 | string icon = 1;
19 | // 动效json文件
20 | string json = 2;
21 | }
22 |
23 | // 活动入口-响应
24 | message EntranceReply {
25 | // 展示图标
26 | string icon = 1;
27 | // 活动名称
28 | string name = 2;
29 | // 活动跳转链接
30 | string url = 3;
31 | // 动画效果
32 | AnimateIcon animate_icon = 4;
33 | }
34 |
35 | // 活动入口-请求
36 | message EntranceReq {}
37 |
38 | //
39 | message PrivacyReply {
40 | //
41 | string message = 1;
42 | }
43 |
44 | //
45 | message PrivacyReq {
46 | //
47 | string activity_uid = 1;
48 | }
49 |
50 | //首页弹窗-响应
51 | message WindowReply {
52 | // 弹窗类型
53 | // 0:弹窗 1:普通页面
54 | int32 type = 1;
55 | // 跳转链接
56 | string url = 2;
57 | // 上报数据字段
58 | string report_data = 3;
59 | }
60 |
61 | // 首页弹窗-请求
62 | message WindowReq {
63 |
64 | }
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/message/main/resource.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.message.main;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | //
8 | service Resource {
9 | //
10 | rpc TopActivity(google.protobuf.Empty) returns (stream TopActivityReply);
11 | }
12 |
13 | //
14 | message TopActivityReply {
15 | // 当前生效的资源
16 | TopOnline online = 1;
17 | // 对online内容进行hash和上次结果一样则不重新加载
18 | string hash = 2;
19 | }
20 |
21 | // 当前生效的资源
22 | message TopOnline {
23 | // 活动类型
24 | // 1:七日活动 2:后台配置
25 | int32 type = 1;
26 | // 图标
27 | string icon = 2;
28 | // 跳转链接
29 | string uri = 3;
30 | // 资源状态标识(后台配置)
31 | string unique_id = 4;
32 | // 动画资源
33 | Animate animate = 5;
34 | // 红点
35 | RedDot red_dot = 6;
36 | // 活动名称
37 | string name = 7;
38 | // 轮询间隔 单位秒
39 | int64 interval = 8;
40 | }
41 |
42 | // 动画资源
43 | message Animate {
44 | // 动效结束展示icon
45 | string icon = 1;
46 | // 7日活动动画
47 | string json = 2;
48 | // s10活动svg动画
49 | string svg = 3;
50 | // 循环次数(默认0不返回 表示无限循环)
51 | int32 loop = 4;
52 | }
53 |
54 | // 红点
55 | message RedDot {
56 | // 红点类型
57 | // 1:纯红点 2:数字红点
58 | int32 type = 1;
59 | // 如果是数字红点 显示的数字
60 | int32 number = 2;
61 | }
62 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/playerunite/v1/playerunite.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.playerunite.v1;
4 |
5 | import "bilibili/playershared/playershared.proto";
6 |
7 | import "google/protobuf/any.proto";
8 |
9 | // 统一视频url
10 | service Player {
11 | // 视频地址
12 | rpc PlayViewUnite (PlayViewUniteReq) returns (PlayViewUniteReply);
13 | }
14 |
15 | //
16 | message PlayViewUniteReq {
17 | // 请求资源VOD信息
18 | bilibili.playershared.VideoVod vod = 1;
19 | //
20 | string spmid = 2;
21 | //
22 | string from_spmid = 3;
23 | // 补充信息, 如ep_id等
24 | map extra_content = 4;
25 | }
26 |
27 | //
28 | message PlayViewUniteReply {
29 | // 音视频流信息
30 | bilibili.playershared.VodInfo vod_info = 1;
31 | //
32 | bilibili.playershared.PlayArcConf play_arc_conf = 2;
33 | //
34 | bilibili.playershared.PlayDeviceConf play_device_conf = 3;
35 | //
36 | bilibili.playershared.Event event = 4;
37 | // 使用 pgcanymodel / ugcanymodel 进行proto any转换成对应业务码结构体
38 | google.protobuf.Any supplement = 5;
39 | //
40 | bilibili.playershared.PlayArc play_arc = 6;
41 | //
42 | bilibili.playershared.QnTrialInfo qn_trial_info = 7;
43 | //
44 | bilibili.playershared.History history = 8;
45 | }
46 |
--------------------------------------------------------------------------------
/assets/zone_icon/sports.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/zone_icon/ad.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/message/main/dm.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.message.main;
4 |
5 | // 实时弹幕事件
6 | message DanmukuEvent {
7 | // 弹幕列表
8 | repeated DanmakuElem elems = 1;
9 | }
10 |
11 | // 弹幕条目
12 | message DanmakuElem {
13 | // 弹幕dmid
14 | int64 id = 1;
15 | // 弹幕出现位置(单位为ms)
16 | int32 progress = 2;
17 | // 弹幕类型
18 | int32 mode = 3;
19 | // 弹幕字号
20 | int32 fontsize = 4;
21 | // 弹幕颜色
22 | uint32 color = 5;
23 | // 发送着mid hash
24 | string mid_hash = 6;
25 | // 弹幕正文
26 | string content = 7;
27 | // 发送时间
28 | int64 ctime = 8;
29 | // 弹幕动作
30 | string action = 9;
31 | // 弹幕池
32 | int32 pool = 10;
33 | // 弹幕id str
34 | string id_str = 11;
35 | }
36 |
37 | // 互动弹幕
38 | message CommandDm {
39 | // 弹幕id
40 | int64 id = 1;
41 | // 对象视频cid
42 | int64 oid = 2;
43 | // 发送者mid
44 | int64 mid = 3;
45 | //
46 | int32 type = 4;
47 | // 互动弹幕指令
48 | string command = 5;
49 | // 互动弹幕正文
50 | string content = 6;
51 | // 弹幕状态
52 | int32 state = 7;
53 | // 出现时间
54 | int32 progress = 8;
55 | // 创建时间
56 | string ctime = 9;
57 | // 发布时间
58 | string mtime = 10;
59 | // 扩展json数据
60 | string extra = 11;
61 | // 弹幕id str类型
62 | string idStr = 12;
63 | }
64 |
--------------------------------------------------------------------------------
/docs/other/time_stamp.md:
--------------------------------------------------------------------------------
1 | # 获取当前时间戳
2 |
3 | ## 获取当前时间戳
4 |
5 | > https://api.bilibili.com/x/report/click/now
6 |
7 | *请求方式:GET*
8 |
9 | **json回复:**
10 |
11 | 根对象:
12 |
13 | | 字段 | 类型 | 内容 | 备注 |
14 | | ------- | ---- | -------- | ------- |
15 | | code | num | 返回值 | 0:成功 |
16 | | message | str | 错误信息 | 默认为0 |
17 | | ttl | num | 1 | |
18 | | data | obj | 信息本体 | |
19 |
20 | `data`对象:
21 |
22 | | 字段 | 类型 | 内容 | 备注 |
23 | | ---- | ---- | ------------ | ---- |
24 | | now | num | 当前的时间戳 | |
25 |
26 | **示例:**
27 |
28 | ```shell
29 | curl 'https://api.bilibili.com/x/report/click/now'
30 | ```
31 |
32 |
33 | 查看响应示例:
34 |
35 | ```json
36 | {
37 | "code": 0,
38 | "message": "0",
39 | "ttl": 1,
40 | "data": {
41 | "now": 1592666471
42 | }
43 | }
44 | ```
45 |
46 |
47 |
48 | ## 获取服务器端UTC时间
49 |
50 | > https://interface.bilibili.com/serverdate.js
51 |
52 | *请求方式:GET*
53 |
54 | **js回复:**
55 |
56 | ```js
57 | window.serverdate = Date.UTC(YYYY, M, D, h, m, s);
58 | ```
59 |
60 | **示例:**
61 |
62 | ```shell
63 | curl 'https://interface.bilibili.com/serverdate.js'
64 | ```
65 |
66 |
67 |
68 | 查看响应示例:
69 |
70 | ```js
71 | window.serverdate = Date.UTC(2021, 4, 16, 17, 31, 8);
72 | ```
73 |
74 |
--------------------------------------------------------------------------------
/assets/img/tuiguang.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/zone_icon/music.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/playeronline/v1/playeronline.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.playeronline.v1;
4 |
5 | // 在线人数
6 | service PlayerOnline {
7 | // 获取在线人数
8 | rpc PlayerOnline (PlayerOnlineReq) returns (PlayerOnlineReply);
9 | //
10 | rpc PremiereInfo(PremiereInfoReq) returns (PremiereInfoReply);
11 | //
12 | rpc ReportWatch(ReportWatchReq) returns (NoReply);
13 | }
14 |
15 | // 空回复
16 | message NoReply {}
17 |
18 | // 获取在线人数-回复
19 | message PlayerOnlineReply {
20 | //
21 | string total_text = 1;
22 | // 下次轮询间隔时间
23 | int64 sec_next = 2;
24 | // 是否底部显示
25 | bool bottom_show = 3;
26 | //
27 | bool sdm_show = 4;
28 | //
29 | string sdm_text = 5;
30 | //
31 | int64 total_number = 6;
32 | //
33 | string total_number_text = 7;
34 | }
35 |
36 | // 获取在线人数-请求
37 | message PlayerOnlineReq {
38 | // 稿件 avid
39 | int64 aid = 1;
40 | // 视频 cid
41 | int64 cid = 2;
42 | // 是否在播放中
43 | bool play_open = 3;
44 | }
45 |
46 | //
47 | message PremiereInfoReply {
48 | //
49 | string premiere_over_text = 1;
50 | //
51 | int64 participant = 2;
52 | //
53 | int64 interaction = 3;
54 | }
55 |
56 | //
57 | message PremiereInfoReq {
58 | //
59 | int64 aid = 1;
60 | }
61 |
62 | //
63 | message ReportWatchReq {
64 | //
65 | int64 aid = 1;
66 | //
67 | string biz = 2;
68 | //
69 | string buvid = 3;
70 | }
--------------------------------------------------------------------------------
/assets/zone_icon/teleplay.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/audio/status_number.md:
--------------------------------------------------------------------------------
1 | # 音频状态数
2 |
3 | ## 歌曲状态数
4 |
5 | >https://www.bilibili.com/audio/music-service-c/web/stat/song
6 |
7 | *请求方式:GET*
8 |
9 | 唯缺投币数2333333
10 |
11 | **url参数:**
12 |
13 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
14 | | ------ | ---- | -------- | ------ | ---- |
15 | | sid | num | 音频auid | 必要 | |
16 |
17 | **json回复:**
18 |
19 | 根对象:
20 |
21 | | 字段 | 类型 | 内容 | 备注 |
22 | | ---- | ---- | -------- | ------------------------------- |
23 | | code | num | 返回值 | 0:成功
72000000:参数错误 |
24 | | msg | str | 错误信息 | 默认为success |
25 | | data | obj | 信息本体 | |
26 |
27 | `data`对象:
28 |
29 | | 字段 | 类型 | 内容 | 备注 |
30 | | ------- | ---- | -------- | ---- |
31 | | sid | num | 音频auid | |
32 | | play | num | 播放次数 | |
33 | | collect | num | 收藏数 | |
34 | | comment | num | 评论数 | |
35 | | share | num | 分享数 | |
36 |
37 | **示例:**
38 |
39 | 查询歌曲`au15664`的状态数
40 |
41 | ```shell
42 | curl -G 'https://www.bilibili.com/audio/music-service-c/web/stat/song' \
43 | --data-urlencode 'sid=15664'
44 | ```
45 |
46 |
47 | 查看响应示例:
48 |
49 | ```json
50 | {
51 | "code": 0,
52 | "msg": "success",
53 | "data": {
54 | "sid": 15664,
55 | "play": 1377390,
56 | "collect": 44340,
57 | "comment": 2756,
58 | "share": 4114
59 | }
60 | }
61 | ```
62 |
63 |
64 |
--------------------------------------------------------------------------------
/docs/message/msg.md:
--------------------------------------------------------------------------------
1 | # 通知消息
2 |
3 | ## 未读消息数
4 |
5 | > https://api.bilibili.com/x/msgfeed/unread
6 |
7 | *请求方式:GET*
8 |
9 | 认证方式:Cookie(SESSDATA)
10 |
11 | **json回复:**
12 |
13 | 根对象:
14 |
15 | | 字段 | 类型 | 内容 | 备注 |
16 | | ------- | ---- | -------- | ----------------------------- |
17 | | code | num | 返回值 | 0:成功
-101:账号未登录 |
18 | | message | str | 错误信息 | 默认为0 |
19 | | ttl | num | 1 | |
20 | | data | obj | 信息本体 | |
21 |
22 | data 对象:
23 |
24 | | 字段 | 类型 | 内容 | 备注 |
25 | | ------- | ---- | -------------- | ------------ |
26 | | at | num | 未读at数 | |
27 | | chat | num | 0 | 作用尚不明确 |
28 | | like | num | 未读点赞数 | |
29 | | reply | num | 未读回复数 | |
30 | | sys_msg | num | 未读系统通知数 | |
31 | | up | num | UP主助手信息数 | |
32 |
33 | **示例:**
34 |
35 | 以下信息代表了未读点赞数为10,未读回复数为4,未读at消息数为3,未读系统通知数为2,UP主助手信息数为1
36 |
37 | ```shell
38 | curl 'https://api.bilibili.com/x/msgfeed/unread' \
39 | -b 'SESSDATA=xxx'
40 | ```
41 |
42 |
43 | 查看响应示例:
44 |
45 | ```json
46 | {
47 | "code": 0,
48 | "message": "0",
49 | "ttl": 1,
50 | "data": {
51 | "at": 3,
52 | "chat": 0,
53 | "like": 10,
54 | "reply": 4,
55 | "sys_msg": 2,
56 | "up": 1
57 | }
58 | }
59 | ```
60 |
61 |
62 |
--------------------------------------------------------------------------------
/docs/other/picture.md:
--------------------------------------------------------------------------------
1 | # 图片格式化
2 |
3 | 对于\*.hdslb.com/bfs下的图片文件都可以使用以下格式化参数
4 |
5 | > \*.hdslb.com/bfs/\*/\*.\[jpg/png/gif\]@{width}w\_{high}h\_{quality}q.{format}
6 |
7 | | 可选参数 | 含义 | 备注 |
8 | | -------- | ---------------- | ---------------- |
9 | | width | 图片最大限制宽度 | |
10 | | high | 图片最大限制高度 | |
11 | | quality | 图片质量百分比 | 仅限webp |
12 | | format | 图片格式 | 仅限png/jpg/webp |
13 |
14 | **示例:**
15 |
16 | 原始图片
17 |
18 | https://i1.hdslb.com/bfs/archive/e5fff1472bad1c0c6bcb3004205f9be23b58ffc0.jpg
19 |
20 | 
21 |
22 | 高度限制为100
23 |
24 | https://i1.hdslb.com/bfs/archive/e5fff1472bad1c0c6bcb3004205f9be23b58ffc0.jpg@100h
25 |
26 | 
27 |
28 | 宽度限制为100
29 |
30 | https://i1.hdslb.com/bfs/archive/e5fff1472bad1c0c6bcb3004205f9be23b58ffc0.jpg@100w
31 |
32 | 
33 |
34 | 转换格式为webp
35 |
36 | https://i1.hdslb.com/bfs/archive/e5fff1472bad1c0c6bcb3004205f9be23b58ffc0.jpg@.webp
37 |
38 | 
39 |
40 | 转换为webp图片质量为1%
41 |
42 | https://i1.hdslb.com/bfs/archive/e5fff1472bad1c0c6bcb3004205f9be23b58ffc0.jpg@1q.webp
43 |
44 | 
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/v1/room.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.v1;
4 |
5 | import "bilibili/rpc/status.proto";
6 | import "google/protobuf/any.proto";
7 |
8 | //
9 | service BroadcastRoom {
10 | //
11 | rpc Enter(stream RoomReq) returns (stream RoomResp);
12 | }
13 |
14 | //
15 | message RoomErrorEvent {
16 | //
17 | bilibili.rpc.Status status = 1;
18 | }
19 |
20 | //
21 | message RoomJoinEvent {
22 |
23 | }
24 |
25 | //
26 | message RoomLeaveEvent {
27 |
28 | }
29 |
30 | //
31 | message RoomMessageEvent {
32 | //
33 | string target_path = 1;
34 | //
35 | google.protobuf.Any body = 2;
36 | }
37 |
38 | //
39 | message RoomOnlineEvent {
40 | //
41 | int32 online = 1;
42 | //
43 | int32 all_online = 2;
44 | }
45 |
46 | //
47 | message RoomReq {
48 | // {type}://{room_id}
49 | string id = 1;
50 | oneof event {
51 | //
52 | RoomJoinEvent join = 2;
53 | //
54 | RoomLeaveEvent leave = 3;
55 | //
56 | RoomOnlineEvent online = 4;
57 | //
58 | RoomMessageEvent msg = 5;
59 | }
60 | }
61 |
62 | //
63 | message RoomResp {
64 | // {type}://{room_id}
65 | string id = 1;
66 | oneof event {
67 | //
68 | RoomJoinEvent join = 2;
69 | //
70 | RoomLeaveEvent leave = 3;
71 | //
72 | RoomOnlineEvent online = 4;
73 | //
74 | RoomMessageEvent msg = 5;
75 | //
76 | RoomErrorEvent err = 6;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/docs/vip/clockin.md:
--------------------------------------------------------------------------------
1 | # 大会员签到
2 |
3 | ## 大积分签到
4 |
5 | > https://api.bilibili.com/pgc/activity/score/task/sign
6 |
7 | *请求方式:POST*
8 |
9 | 认证方式:Cookie (SESSDATA) / access_key
10 |
11 | Cookie 鉴权方式下需要满足以下条件:
12 | - `Referer`在`*.bilibili.com`域名下
13 | - `SESSDATA` 需要进行 url 编码,即 `,` 替换为 `%2C`
14 |
15 | **正文参数( application/x-www-form-urlencoded ):**
16 |
17 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
18 | | ---------- | ---- | ----------------------- | -------------- | ---- |
19 | | access_key | str | APP登录Token | APP方式必要 | |
20 | | csrf | str | CSRF Token (位于cookie) | 非必要 | |
21 |
22 | **json回复:**
23 |
24 | 根对象:
25 |
26 | | 字段名 | 类型 | 内容 | 备注 |
27 | | ------- | ---- | -------- | ------------------------------------------------------------ |
28 | | code | num | 响应码 | 0:成功
-101:账号未登录
-401:非法访问
-403:访问权限不足 |
29 | | message | str | 错误信息 | |
30 |
31 | **示例:**
32 |
33 | web 方式:
34 |
35 | ```shell
36 | curl 'https://api.bilibili.com/pgc/activity/score/task/sign' \
37 | --data-urlencode 'csrf=xxx' \
38 | -b 'SESSDATA=xxx' \
39 | --referer 'https://www.bilibili.com'
40 | ```
41 |
42 | APP 方式:
43 |
44 | ```shell
45 | curl 'https://api.bilibili.com/pgc/activity/score/task/sign' \
46 | --data-urlencode 'access_key=xxx'
47 | ```
48 |
49 |
50 | 查看响应示例:
51 |
52 |
53 | ```json
54 | {
55 | "code": 0,
56 | "message": "success"
57 | }
58 | ```
59 |
60 |
61 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/api/player/v1/player.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.api.player.v1;
4 |
5 | // 心跳上报
6 | service Heartbeat {
7 | // 客户端心跳上报
8 | rpc Mobile(HeartbeatReq) returns (HeartbeatReply);
9 | }
10 |
11 | // 客户端心跳上报-响应
12 | message HeartbeatReply {
13 | // 时间戳
14 | int64 ts = 1;
15 | }
16 |
17 | // 客户端心跳上报-请求
18 | message HeartbeatReq {
19 | //
20 | int64 server_time = 1;
21 | //
22 | string session = 2;
23 | // 用户 mid
24 | int64 mid = 3;
25 | // 稿件 avid
26 | int64 aid = 4;
27 | // 视频 cid
28 | int64 cid = 5;
29 | //
30 | string sid = 6;
31 | //
32 | int64 epid = 7;
33 | //
34 | string type = 8;
35 | //
36 | int32 sub_type = 9;
37 | //
38 | int32 quality = 10;
39 | //
40 | int64 total_time = 11;
41 | //
42 | int64 paused_time = 12;
43 | //
44 | int64 played_time = 13;
45 | //
46 | int64 video_duration = 14;
47 | //
48 | string play_type = 15;
49 | //
50 | int32 network_type = 16;
51 | //
52 | int64 last_play_progress_time = 17;
53 | //
54 | int64 max_play_progress_time = 18;
55 | //
56 | int32 from = 19;
57 | //
58 | string from_spmid = 20;
59 | //
60 | string spmid = 21;
61 | //
62 | string epid_status = 22;
63 | //
64 | string play_status = 23;
65 | //
66 | string user_status = 24;
67 | //
68 | int64 actual_played_time = 25;
69 | //
70 | int32 auto_play = 26;
71 | //
72 | int64 list_play_time = 27;
73 | //
74 | int64 detail_play_time = 28;
75 | }
76 |
--------------------------------------------------------------------------------
/assets/zone_icon/fashion.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/clientinfo/ip.md:
--------------------------------------------------------------------------------
1 | # 通过ip确定地理位置
2 |
3 | ## 通过ip确定位置
4 |
5 | > https://api.bilibili.com/x/web-interface/zone
6 |
7 | *请求方式:GET*
8 |
9 | **json回复:**
10 |
11 | 根对象:
12 |
13 | | 字段 | 类型 | 内容 | 备注 |
14 | | ------- | ---- | -------- | ------- |
15 | | code | num | 返回值 | 0:成功 |
16 | | message | str | 错误信息 | 默认为0 |
17 | | ttl | num | 1 | |
18 | | data | obj | 信息本体 | |
19 |
20 | `data`对象:
21 |
22 | | 字段 | 类型 | 内容 | 备注 |
23 | | ------------ | ---- | ------------- | ------------ |
24 | | addr | str | 公网IP地址 | |
25 | | country | str | 国家/地区名 | |
26 | | province | str | 省/州 | 非必须存在项 |
27 | | city | str | 城市 | 非必须存在项 |
28 | | isp | str | 运营商名 | |
29 | | latitude | num | 纬度 | |
30 | | longitude | num | 经度 | |
31 | | zone_id | num | ip数据库id | |
32 | | country_code | num | 国家/地区代码 | |
33 |
34 | **示例:**
35 |
36 | ```shell
37 | curl 'https://api.bilibili.com/x/web-interface/zone'
38 | ```
39 |
40 |
41 | 查看响应示例:
42 |
43 | ```json
44 | {
45 | "code":0,
46 | "message":"0",
47 | "ttl":1,
48 | "data":{
49 | "addr":"36.40.120.145",
50 | "country":"中国",
51 | "province":"陕西",
52 | "city":"渭南",
53 | "isp":"电信",
54 | "latitude":34.4995,
55 | "longitude":109.492821,
56 | "zone_id":4472912,
57 | "country_code":86
58 | }
59 | }
60 | ```
61 |
62 |
63 |
--------------------------------------------------------------------------------
/assets/zone_icon/information.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/vip/action.md:
--------------------------------------------------------------------------------
1 | # 大会员操作
2 |
3 | ## 兑换卡券
4 |
5 | > https://api.bilibili.com/x/vip/privilege/receive
6 |
7 | *请求方式:POST*
8 |
9 | 认证方式:Cookie (SESSDATA)
10 |
11 | **正文参数 (application/x-www-form-urlencoded):**
12 |
13 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
14 | | ------ | ---- | ----------------------- | --------------- | ------------------------------------------------------------ |
15 | | type | num | 兑换类型 | 必要 | 1:B币券
2:会员购优惠券
3:漫画福利券
4:会员购包邮券
5:漫画商城优惠券 |
16 | | csrf | str | CSRF Token (位于cookie) | Cookie 方式必要 | |
17 |
18 | **json回复:**
19 |
20 | 根对象:
21 |
22 | | 字段 | 类型 | 内容 | 备注 |
23 | |---------|-----|------|---------------------------------------------------------------------------------------------------|
24 | | code | num | 返回值 | -101:账号未登录
-111:csrf 校验失败
-400:请求错误
69800:网络繁忙 请稍后再试
69801:你已领取过该权益
0:成功 |
25 | | message | str | 错误信息 | |
26 | | ttl | num | 1 | |
27 |
28 | **示例:**
29 |
30 | ```shell
31 | curl 'https://api.bilibili.com/x/vip/privilege/receive' \
32 | -b 'SESSDATA=xxx' \
33 | --data-urlencode 'type=1' \
34 | --data-urlencode 'csrf=xxx'
35 | ```
36 |
37 |
38 | 查看响应示例:
39 |
40 | ```json
41 | {
42 | "code": 0,
43 | "message": "0",
44 | "ttl": 1
45 | }
46 | ```
47 |
48 |
49 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/polymer/contract/contract.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.polymer.contract;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | // 契约
8 | service Contract {
9 | //
10 | rpc AddContract(AddContractReq) returns (google.protobuf.Empty);
11 | //
12 | rpc AddContractV2(AddContractReq) returns (AddContractReply);
13 | //
14 | rpc ContractConfig(ContractConfigReq) returns (ContractConfigReply);
15 | }
16 |
17 | //
18 | message AddContractReply {
19 | //
20 | bool allow_message = 1;
21 | //
22 | bool allow_reply = 2;
23 | //
24 | string input_text = 3;
25 | //
26 | string input_title = 4;
27 | }
28 |
29 | //
30 | message AddContractReq {
31 | //
32 | CommonReq common = 1;
33 | //
34 | int64 mid = 2;
35 | //
36 | int64 up_mid = 3;
37 | //
38 | int64 aid = 4;
39 | //
40 | int32 source = 5;
41 | }
42 |
43 | //
44 | message CommonReq {
45 | //
46 | string platform = 1;
47 | //
48 | int32 build = 2;
49 | //
50 | string buvid = 3;
51 | //
52 | string mobi_app = 4;
53 | //
54 | string device = 5;
55 | //
56 | string ip = 6;
57 | //
58 | string spmid = 7;
59 | }
60 |
61 | //
62 | message ContractCard {
63 | //
64 | string title = 1;
65 | //
66 | string sub_title = 2;
67 | }
68 |
69 | //
70 | message ContractConfigReply {
71 | //
72 | int32 is_follow_display = 1;
73 | //
74 | int32 is_triple_display = 2;
75 | //
76 | ContractCard contract_card = 3;
77 | }
78 |
79 | //
80 | message ContractConfigReq {
81 | //
82 | CommonReq common = 1;
83 | //
84 | int64 mid = 2;
85 | //
86 | int64 up_mid = 3;
87 | //
88 | int64 aid = 4;
89 | //
90 | int32 source = 5;
91 | }
92 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/message/tv/proj.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.message.tv;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | //
8 | service Tv {
9 | // 投屏
10 | rpc Proj(google.protobuf.Empty) returns (stream ProjReply);
11 | // 直播状态
12 | rpc LiveStatus(google.protobuf.Empty) returns (stream LiveStatusNotify);
13 | // 赛事比分通知
14 | rpc Esports(google.protobuf.Empty) returns (stream EsportsNotify);
15 | // 直播插卡
16 | rpc Publicity(google.protobuf.Empty) returns (stream PublicityNotify);
17 | // 直转点
18 | rpc LiveSkip(google.protobuf.Empty) returns (stream LiveSkipNotify);
19 | }
20 |
21 | // 投屏
22 | message ProjReply {
23 | // 投屏命令
24 | // 1:起播 2:快进 3:快退 4:seek播放进度 5:暂停 6:暂停恢复
25 | int64 cmd_type = 1;
26 | // 用户id
27 | int64 mid = 2;
28 | // 稿件id
29 | int64 aid = 3;
30 | // 视频id
31 | int64 cid = 4;
32 | // 视频类型
33 | // 0:ugc 1:pgc 2:pugv
34 | int64 video_type = 5;
35 | // 单集id,pgc和pugv需要传
36 | int64 ep_id = 6;
37 | // 剧集id
38 | int64 season_id = 7;
39 | // seek 的位置,cmd位seek时有值,单位秒
40 | int64 seek_ts = 8;
41 | // 其他指令对应内容
42 | string extra = 9;
43 | }
44 |
45 | // 直播状态
46 | message LiveStatusNotify {
47 | // 直播状态
48 | // 1:开播 2:关播 3:截流 4:截流恢复
49 | int64 status = 1;
50 | // 文案
51 | string msg = 2;
52 | // 直播房间号
53 | int64 cid = 3;
54 | }
55 |
56 | //
57 | message EsportsNotify {
58 | // 直播房间号
59 | int64 cid = 1;
60 | }
61 |
62 | // 直播插卡
63 | message PublicityNotify {
64 | // 插卡id
65 | int64 publicity_id = 1;
66 | // 直播房间号
67 | int64 room_id = 2;
68 | // 直播间状态
69 | // 0:未开播 1:直播中 2:轮播中
70 | int64 status = 3;
71 | }
72 |
73 | // 直转点
74 | message LiveSkipNotify {
75 | // 直播id
76 | int64 live_id = 1;
77 | }
--------------------------------------------------------------------------------
/assets/img/blackroom.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/other/errcode.md:
--------------------------------------------------------------------------------
1 | # 公共错误码
2 |
3 | 下表为大部分接口返回值中`code`字段值中公共的错误代码
4 |
5 | ## 权限类
6 |
7 | | 代码 | 含义 |
8 | | ---- | -------------------------- |
9 | | -1 | 应用程序不存在或已被封禁 |
10 | | -2 | Access Key 错误 |
11 | | -3 | API 校验密匙错误 |
12 | | -4 | 调用方对该 Method 没有权限 |
13 | | -101 | 账号未登录 |
14 | | -102 | 账号被封停 |
15 | | -103 | 积分不足 |
16 | | -104 | 硬币不足 |
17 | | -105 | 验证码错误 |
18 | | -106 | 账号非正式会员或在适应期 |
19 | | -107 | 应用不存在或者被封禁 |
20 | | -108 | 未绑定手机 |
21 | | -110 | 未绑定手机 |
22 | | -111 | csrf 校验失败 |
23 | | -112 | 系统升级中 |
24 | | -113 | 账号尚未实名认证 |
25 | | -114 | 请先绑定手机 |
26 | | -115 | 请先完成实名认证 |
27 |
28 | ## 请求类
29 |
30 | | 代码 | 含义 |
31 | | ---- | --------------------- |
32 | | -304 | 木有改动 |
33 | | -307 | 撞车跳转 |
34 | | -400 | 请求错误 |
35 | | -401 | 未认证 (或非法请求) |
36 | | -403 | 访问权限不足 |
37 | | -404 | 啥都木有 |
38 | | -405 | 不支持该方法 |
39 | | -409 | 冲突 |
40 | | -412 | 请求被拦截 (客户端 ip 被服务端风控) |
41 | | -500 | 服务器错误 |
42 | | -503 | 过载保护,服务暂不可用 |
43 | | -504 | 服务调用超时 |
44 | | -509 | 超出限制 |
45 | | -616 | 上传文件不存在 |
46 | | -617 | 上传文件太大 |
47 | | -625 | 登录失败次数太多 |
48 | | -626 | 用户不存在 |
49 | | -628 | 密码太弱 |
50 | | -629 | 用户名或密码错误 |
51 | | -632 | 操作对象数量限制 |
52 | | -643 | 被锁定 |
53 | | -650 | 用户等级太低 |
54 | | -652 | 重复的用户 |
55 | | -658 | Token 过期 |
56 | | -662 | 密码时间戳过期 |
57 | | -688 | 地理区域限制 |
58 | | -689 | 版权限制 |
59 | | -701 | 扣节操失败 |
60 | |-8888|对不起,服务器开小差了~ (ಥ﹏ಥ)|
61 |
--------------------------------------------------------------------------------
/grpc_api/pgc/gateway/vega/v1/vega.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package pgc.gateway.vega.v1;
4 |
5 | import "bilibili/rpc/status.proto";
6 | import "google/protobuf/any.proto";
7 | import "google/protobuf/empty.proto";
8 |
9 | //
10 | service Vega {
11 | //
12 | rpc CreateTunnel (VegaFrame) returns (VegaFrame);
13 | }
14 |
15 | //
16 | service VegaFrameDoc {
17 | //
18 | rpc Auth (AuthReq) returns (AuthResp);
19 | //
20 | rpc Heartbeat (HeartbeatReq) returns (HeartbeatResp);
21 | //
22 | rpc MessageAck (MessageAckReq) returns (google.protobuf.Empty);
23 | //
24 | rpc Subscribe (SubscribeReq) returns (google.protobuf.Empty);
25 | }
26 |
27 | //
28 | message AuthReq {}
29 |
30 | //
31 | message AuthResp {}
32 |
33 | //
34 | message FrameOption {
35 | //
36 | int64 vega_id = 1;
37 | //
38 | string req_id = 2;
39 | //
40 | int64 sequence = 3;
41 | //
42 | bool is_ack = 4;
43 | //
44 | bilibili.rpc.Status status = 5;
45 | //
46 | string ack_origin = 6;
47 | //
48 | int64 mid = 7;
49 | }
50 |
51 | //
52 | message HeartbeatReq {}
53 |
54 | //
55 | message HeartbeatResp {}
56 |
57 | //
58 | message MessageAckReq {
59 | //
60 | string vega_id = 1;
61 | //
62 | string req_id = 2;
63 | //
64 | string origin = 3;
65 | //
66 | string target_path = 4;
67 | }
68 |
69 | //
70 | message SubscribeReq {
71 | //
72 | repeated TargetPath target_paths = 1;
73 | }
74 |
75 | //
76 | message TargetPath {
77 | //
78 | string key = 1;
79 | //
80 | google.protobuf.Any subs = 2;
81 | }
82 |
83 | //
84 | message VegaFrame {
85 | //
86 | FrameOption options = 1;
87 | //
88 | string route_path = 2;
89 | //
90 | google.protobuf.Any body = 3;
91 | //
92 | google.protobuf.Any sub_biz = 4;
93 | }
94 |
--------------------------------------------------------------------------------
/assets/zone_icon/knowledge.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/article/category.md:
--------------------------------------------------------------------------------
1 | # 专栏分类
2 |
3 | ## 游戏
4 |
5 | | id | parent_id | name |
6 | |-----|-----------|------|
7 | | 1 | 0 | 游戏 |
8 | | 6 | 1 | 单机游戏 |
9 | | 7 | 1 | 电子竞技 |
10 | | 8 | 1 | 手机游戏 |
11 | | 9 | 1 | 网络游戏 |
12 | | 10 | 1 | 桌游棋牌 |
13 |
14 | ## 动画
15 |
16 | | id | parent_id | name |
17 | |-----|-----------|------|
18 | | 2 | 0 | 动画 |
19 | | 4 | 2 | 动漫杂谈 |
20 | | 5 | 2 | 动漫资讯 |
21 | | 31 | 2 | 动画技术 |
22 |
23 | ## 生活
24 |
25 | | id | parent_id | name |
26 | |-----|-----------|------|
27 | | 3 | 0 | 生活 |
28 | | 13 | 3 | 美食 |
29 | | 14 | 3 | 时尚 |
30 | | 15 | 3 | 日常 |
31 | | 21 | 3 | 萌宠 |
32 | | 22 | 3 | 运动 |
33 |
34 | ## 轻小说
35 |
36 | | id | parent_id | name |
37 | |-----|-----------|------|
38 | | 16 | 0 | 轻小说 |
39 | | 18 | 16 | 原创连载 |
40 | | 19 | 16 | 同人连载 |
41 | | 20 | 16 | 小说杂谈 |
42 | | 32 | 16 | 短篇小说 |
43 |
44 | ## 科技
45 |
46 | | id | parent_id | name |
47 | |-----|-----------|------|
48 | | 17 | 0 | 科技 |
49 | | 25 | 17 | 人文历史 |
50 | | 26 | 17 | 数码 |
51 | | 27 | 17 | 汽车 |
52 | | 33 | 17 | 自然 |
53 | | 34 | 17 | 学习 |
54 |
55 | ## 影视
56 |
57 | | id | parent_id | name |
58 | |-----|-----------|------|
59 | | 28 | 0 | 影视 |
60 | | 12 | 28 | 电影 |
61 | | 35 | 28 | 电视剧 |
62 | | 36 | 28 | 纪录片 |
63 | | 37 | 28 | 综艺 |
64 |
65 | ## 兴趣
66 |
67 | | id | parent_id | name |
68 | |-----|-----------|------|
69 | | 29 | 0 | 兴趣 |
70 | | 11 | 29 | 模型手办 |
71 | | 23 | 29 | 绘画 |
72 | | 24 | 29 | 手工 |
73 | | 38 | 29 | 摄影 |
74 | | 39 | 29 | 音乐舞蹈 |
75 |
76 | ## 笔记
77 |
78 | | id | parent_id | name |
79 | |-----|-----------|------|
80 | | 41 | 0 | 笔记 |
81 | | 42 | 41 | 全部笔记 |
82 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/distribution/setting/experimental.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.distribution.setting.experimental;
4 |
5 | import "bilibili/app/distribution/v1/distribution.proto";
6 |
7 | //
8 | message DynamicSelect {
9 | //
10 | bilibili.app.distribution.v1.BoolValue fold = 1;
11 | }
12 |
13 | //
14 | message Exp {
15 | //
16 | bilibili.app.distribution.v1.Int64Value id = 1;
17 | //
18 | bilibili.app.distribution.v1.Int32Value bucket = 2;
19 | }
20 |
21 | //
22 | message ExperimentalConfig {
23 | //
24 | bilibili.app.distribution.v1.StringValue flag = 1;
25 | //
26 | repeated Exp exps = 2;
27 | }
28 |
29 | //
30 | message MultipleTusConfig {
31 | //
32 | TopLeft top_left = 1;
33 | //
34 | DynamicSelect dynamic_select = 2;
35 | }
36 |
37 | // APP首页头像跳转信息
38 | message TopLeft {
39 | //
40 | bilibili.app.distribution.v1.StringValue url = 1;
41 | //
42 | bilibili.app.distribution.v1.StringValue story_foreground_image = 2;
43 | //
44 | bilibili.app.distribution.v1.StringValue story_background_image = 3;
45 | //
46 | bilibili.app.distribution.v1.StringValue listen_foreground_image = 4;
47 | //
48 | bilibili.app.distribution.v1.StringValue listen_background_image = 5;
49 | //
50 | bilibili.app.distribution.v1.StringValue ios_story_foreground_image = 6;
51 | //
52 | bilibili.app.distribution.v1.StringValue ios_story_background_image = 7;
53 | //
54 | bilibili.app.distribution.v1.StringValue ios_listen_foreground_image = 8;
55 | //
56 | bilibili.app.distribution.v1.StringValue ios_listen_background_image = 9;
57 | //
58 | bilibili.app.distribution.v1.StringValue goto = 10;
59 | //
60 | bilibili.app.distribution.v1.StringValue url_v2 = 11;
61 | //
62 | bilibili.app.distribution.v1.Int64Value goto_v2 = 12;
63 | //
64 | bilibili.app.distribution.v1.StringValue badge = 13;
65 | }
66 |
--------------------------------------------------------------------------------
/assets/img/follow.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
24 |
--------------------------------------------------------------------------------
/assets/zone_icon/kichiku.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/zone_icon/car.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/danmaku/snapshot.md:
--------------------------------------------------------------------------------
1 | # 弹幕快照
2 |
3 | ## 获取弹幕快照
4 |
5 | > https://api.bilibili.com/x/v2/dm/ajax
6 |
7 | *请求方式:GET*
8 |
9 | 最近产生的几条弹幕内容,**最多20条**
10 |
11 | **url参数:**
12 |
13 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
14 | | ------ | -------- | ------------------ | ------ | ---- |
15 | | aid | num或str | 稿件avid或稿件bvid | 必要 | |
16 |
17 | **json回复:**
18 |
19 | 根对象:
20 |
21 | | 字段 | 类型 | 内容 | 备注 |
22 | | ------- | ----- | -------- | --------------------------------------------- |
23 | | code | num | 返回值 | 0:成功
-400:请求错误
-404:无视频 |
24 | | message | str | 错误信息 | 默认为0 |
25 | | ttl | num | 1 | |
26 | | data | array | 预览列表 | |
27 |
28 | `data`数组:
29 |
30 | | 项 | 类型 | 内容 | 备注 |
31 | | ---- | ---- | --------------- | -------- |
32 | | 0 | str | 预览内容1 | |
33 | | n | str | 预览内容(n+1) | |
34 | | …… | str | …… | …… |
35 | | 19 | str | 预览内容20 | 最后一条 |
36 |
37 | **示例:**
38 |
39 | 获取视频`av43337021`/`BV1rb411m7gE`的弹幕快照,总计20条
40 |
41 | avid方式:
42 |
43 | ```shell
44 | curl -G 'https://api.bilibili.com/x/v2/dm/ajax' \
45 | --data-urlencode 'aid=43337021'
46 | ```
47 |
48 | bvid方式:
49 |
50 | ```shell
51 | curl -G 'https://api.bilibili.com/x/v2/dm/ajax' \
52 | --data-urlencode 'aid=BV1rb411m7gE'
53 | ```
54 |
55 |
56 | 查看响应示例:
57 |
58 | ```json
59 | {
60 | "code": 0,
61 | "message": "0",
62 | "ttl": 1,
63 | "data": [
64 | "漫画比动漫好看而且血腥",
65 | "666",
66 | "金木小天使",
67 | "太喜欢了",
68 | "每天一遍防止抑郁",
69 | "我还记得土豆那时候还有的看",
70 | "把在给我摸摸~",
71 | "突然泪目",
72 | "感谢野生字幕君",
73 | "993-7",
74 | "刚刚出的时候小学看,现在高二了",
75 | "原版op有这么长吗?搞笑,肯定做了剪辑,op会给你放全歌?",
76 | "让你看个op 3 : 5 4 秒?",
77 | "说原版不原版的都是弱智",
78 | "樱花",
79 | "请打开洗脑循环食用,请打开洗脑循环食用,请打开洗脑循环食用,请打开洗脑循环食用,请打开洗脑循环食用,",
80 | "再来亿遍",
81 | "错的不是我,而是这个世界。",
82 | "吃货的第一季的最后一季足以让他封神!",
83 | "+"
84 | ]
85 | }
86 | ```
87 |
88 |
89 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/space/v1/space.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.space.v1;
4 |
5 | //
6 | service Space {
7 | //
8 | rpc Archive (ArchiveReq) returns (ArchiveReply);
9 | }
10 |
11 | //-响应
12 | message ArchiveReply {
13 | //
14 | repeated BiliSpaceVideo item = 1;
15 | //
16 | int32 count = 2;
17 | //
18 | EpisodicButton episodic_button = 3;
19 | //
20 | repeated OrderConfig order = 4;
21 | }
22 |
23 | //-请求
24 | message ArchiveReq {
25 | //
26 | int64 vmid = 1;
27 | //
28 | int32 pn = 2;
29 | //
30 | int32 ps = 3;
31 | //
32 | string order = 4;
33 | }
34 |
35 | //
36 | message Badge {
37 | //
38 | string text = 1;
39 | //
40 | string text_color = 2;
41 | //
42 | string text_color_night = 3;
43 | //
44 | string bg_color = 4;
45 | //
46 | string bg_color_night = 5;
47 | //
48 | string border_color = 6;
49 | //
50 | string border_color_night = 7;
51 | //
52 | int32 bg_style = 8;
53 | }
54 |
55 | //
56 | message BiliSpaceVideo {
57 | //
58 | string title = 1;
59 | //
60 | string tname = 2;
61 | //
62 | int64 duration = 3;
63 | //
64 | string cover = 4;
65 | //
66 | string uri = 5;
67 | //
68 | string param = 6;
69 | //
70 | string danmaku = 7;
71 | //
72 | int32 play = 8;
73 | //
74 | int64 ctime = 9;
75 | //
76 | bool state = 10;
77 | //
78 | bool is_popular = 11;
79 | //
80 | repeated Badge badges = 12;
81 | //
82 | string cover_right = 13;
83 | //
84 | string bvid = 14;
85 | //
86 | bool is_steins = 15;
87 | //
88 | bool is_ugcpay = 16;
89 | //
90 | bool is_cooperation = 17;
91 | }
92 |
93 | //
94 | message EpisodicButton {
95 | //
96 | string text = 1;
97 | //
98 | string uri = 2;
99 | }
100 |
101 | //
102 | message OrderConfig {
103 | //
104 | string title = 1;
105 | //
106 | string value = 2;
107 | }
108 |
--------------------------------------------------------------------------------
/assets/zone_icon/cinephile.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/manga/Activity.md:
--------------------------------------------------------------------------------
1 | # 漫画任务操作
2 |
3 | ## 分享漫画
4 |
5 | > https://manga.bilibili.com/twirp/activity.v1.Activity/ShareComic
6 |
7 | *请求方式:POST*
8 |
9 | 认证方式:Cookie(SESSDATA)/ APP
10 |
11 | **正文参数( application/x-www-form-urlencoded ):**
12 |
13 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
14 | | -------- | ---- | ---- | ------ | ------- |
15 | | platform | str | 平台 | 必要 | android |
16 |
17 | **json 回复:**
18 |
19 | 根对象:
20 |
21 | | 字段 | 类型 | 内容 | 备注 |
22 | | ---- | --------- | -------- | ------------------------------------------------------- |
23 | | code | num / str | 返回值 | 见对应表格 |
24 | | msg | str | 错误信息 | |
25 | | meta | obj | 错误信息 | invalid_argument 时存在,例如 `{"argument":"platform"}` |
26 | | data | obj | | `code` 为 0,`msg` 为空时存在 |
27 |
28 | `code` - `msg` 对应表:
29 |
30 | | code | code 类型 | msg | 备注 |
31 | | ---------------- | --------- | ------------------ | --------------------------- |
32 | | 0 | num | 空 | 分享成功,`data` 存在 |
33 | | 0 | num | 今日已分享 | |
34 | | invalid_argument | str | xxxx must be valid | xxxx 字段为必须,`meta`存在 |
35 | | unauthenticated | str | must login | 必须登录才能分享 |
36 |
37 | `data` 对象:
38 |
39 | | 字段 | 类型 | 内容 | 备注 |
40 | | ----- | ---- | -------- | ---- |
41 | | point | num | 获取积分 | |
42 |
43 | **示例:**
44 |
45 | ```bash
46 | curl -X POST https://manga.bilibili.com/twirp/activity.v1.Activity/ShareComic \
47 | -b "SESSDATA=xxxxx" \
48 | --data-urlencode 'platform=android'
49 | ```
50 |
51 |
52 | 分享成功:
53 |
54 | ```json
55 | {
56 | "code": 0,
57 | "msg": "",
58 | "data": {
59 | "point": 5
60 | }
61 | }
62 | ```
63 |
64 |
65 |
66 |
67 | 今日已分享:
68 |
69 | ```json
70 | {
71 | "code": 0,
72 | "msg": "今日已分享"
73 | }
74 | ```
75 |
76 |
77 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/distribution/setting/play.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.distribution.setting.play;
4 |
5 | import "bilibili/app/distribution/v1/distribution.proto";
6 |
7 | // 云端保存的播放器配置
8 | message CloudPlayConfig {
9 | // 启用杜比全景声
10 | bilibili.app.distribution.v1.BoolValue enable_panorama = 1;
11 | // 启用杜比音效
12 | bilibili.app.distribution.v1.BoolValue enable_dolby = 2;
13 | // 启用震动
14 | bilibili.app.distribution.v1.BoolValue enable_shake = 3;
15 | // 启用后台播放
16 | bilibili.app.distribution.v1.BoolValue enable_background = 4;
17 | // 启用HIRES
18 | bilibili.app.distribution.v1.BoolValue enable_loss_less = 5;
19 | }
20 |
21 | // 播放器策略配置
22 | message PlayConfig {
23 | //
24 | bilibili.app.distribution.v1.BoolValue should_auto_play = 1;
25 | //
26 | bilibili.app.distribution.v1.BoolValue should_auto_fullscreen = 2;
27 | //
28 | bilibili.app.distribution.v1.BoolValue enable_playurl_https = 3;
29 | //
30 | bilibili.app.distribution.v1.BoolValue enable_danmaku_interaction = 4;
31 | //
32 | bilibili.app.distribution.v1.Int64Value small_screen_status = 5;
33 | //
34 | bilibili.app.distribution.v1.Int64Value player_codec_mode_key = 6;
35 | //
36 | bilibili.app.distribution.v1.BoolValue enable_gravity_rotate_screen = 7;
37 | //
38 | bilibili.app.distribution.v1.BoolValue enable_danmaku_monospaced = 8;
39 | //
40 | bilibili.app.distribution.v1.BoolValue enable_edit_subtitle = 9;
41 | //
42 | bilibili.app.distribution.v1.BoolValue enable_subtitle = 10;
43 | //
44 | bilibili.app.distribution.v1.Int64Value color_filter = 11;
45 | //
46 | bilibili.app.distribution.v1.BoolValue should_auto_story = 12;
47 | //
48 | bilibili.app.distribution.v1.BoolValue landscape_auto_story = 13;
49 | //
50 | bilibili.app.distribution.v1.BoolValue volume_balance = 14;
51 | }
52 |
53 | // 灰度测试特殊功能?
54 | message SpecificPlayConfig {
55 | //
56 | bilibili.app.distribution.v1.BoolValue enable_segmented_section = 1;
57 | }
58 |
59 |
--------------------------------------------------------------------------------
/docs/login/exit.md:
--------------------------------------------------------------------------------
1 | # 退出账号登录
2 |
3 | ## 退出登录(web端)
4 |
5 | > https://passport.bilibili.com/login/exit/v2
6 |
7 | _请求方式:POST_
8 |
9 | 认证方式:Cookie
10 |
11 | 验证登录成功后会使用`set-cookie`字段清空以下 cookie 项:
12 |
13 | `DedeUserID` `DedeUserID__ckMd5` `SESSDATA` `bili_jct`
14 |
15 | 并在服务器注销该登录 Token (SESSDATA),该 Token 即失效
16 |
17 | 请求必须包含以下cookie项:`DedeUserID` `bili_jct` `SESSDATA`
18 |
19 | **正文参数 (application/x-www-form-urlencoded):**
20 |
21 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
22 | | -------- | ---- | ---------------------------------------- | ------ | --------------------------------- |
23 | | biliCSRF | str | CSRF Token (位于 cookie 中的 `bili_jct`) | 必要 | |
24 | | gourl | str | 成功后跳转到的页面 | 非必要 | 默认为`javascript:history.go(-1)` |
25 |
26 | **json 回复:**
27 |
28 | 如果 cookie 已经失效则输出登录页 html
29 |
30 | 根对象:
31 |
32 | | 字段 | 类型 | 内容 | 备注 |
33 | | ------- | ----------- | -------- | --------------------------------- |
34 | | code | num | 返回值 | 0:成功
2202:csrf 请求非法 |
35 | | status | bool | 返回值 | `true`:成功 |
36 | | ts | num | 时间戳 | |
37 | | message | str | 错误信息 | 成功时不存在 |
38 | | data | 有效时:obj | 信息本体 | 失败时不存在 |
39 |
40 | `data`对象:
41 |
42 | | 字段 | 类型 | 内容 | 备注 |
43 | | ----------- | ---- | ---------- | ---- |
44 | | redirectUrl | str | 重定向 url | |
45 |
46 | **示例:**
47 |
48 | ```shell
49 | curl -L -X POST 'https://passport.bilibili.com/login/exit/v2' \
50 | -H 'Cookie: DedeUserID=xxx; bili_jct=xxx; SESSDATA=xxx' \
51 | -H 'Content-Type: application/x-www-form-urlencoded' \
52 | --data-urlencode 'biliCSRF=xxxxxx'
53 | ```
54 |
55 |
56 | 查看响应示例:
57 |
58 | ```json
59 | {
60 | "code": 0,
61 | "status": true,
62 | "ts": 1663034005,
63 | "data": {
64 | "redirectUrl": "https://passport.biligame.com/crossDomain?DedeUserID=&DedeUserID__ckMd5=&SESSDATA=&bili_jct=&gourl=javascript%3Ahistory.go%28-1%29"
65 | }
66 | }
67 | ```
68 |
--------------------------------------------------------------------------------
/docs/login/login_notice.md:
--------------------------------------------------------------------------------
1 | # 登录记录
2 |
3 | ## 查询登录记录
4 |
5 | > https://api.bilibili.com/x/safecenter/login_notice
6 |
7 | *请求方式:GET*
8 |
9 | 认证方式:Cookie(SESSDATA)
10 |
11 | **url参数:**
12 |
13 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
14 | | ------ | ---- | ---------- | ------ | ------------------------------------------------------------ |
15 | | mid | num | 用户mid | 必要 | |
16 | | buvid | str | 设备虚拟id | 非必要 | web端为操作登录接口时Cookie中的`buvid3`
若登录设备无`buvid`则留空 |
17 |
18 | **json回复:**
19 |
20 | 根对象:
21 |
22 | | 字段 | 类型 | 内容 | 备注 |
23 | | ------- | ---- | -------- | --------------------------- |
24 | | code | num | 返回值 | 0:成功
-101:账号未登录
-400:请求错误 |
25 | | message | str | 错误信息 | 默认为0 |
26 | | ttl | num | 1 | |
27 | | data | obj | 信息本体 | |
28 |
29 | `data`对象:
30 |
31 | | 字段 | 类型 | 内容 | 备注 |
32 | | ----------- | ---- | ----------- | -------------------------- |
33 | | mid | num | 登录用户mid | |
34 | | device_name | str | 登录设备 | 依靠操作登录接口时的UA决定 |
35 | | login_type | str | 登录方式 | 根据登录接口决定 |
36 | | login_time | str | 登录时间 | YYYY-MM-DD hh:mm:ss |
37 | | location | str | 登录位置 | 依靠ip决定 |
38 | | ip | str | 登录ip | 部分用`*`打码 |
39 |
40 | **示例:**
41 |
42 | 查询用户`293793435`设备id为`fuck_chenrui`的登录记录
43 |
44 | ```shell
45 | curl -G 'https://api.bilibili.com/x/safecenter/login_notice' \
46 | --data-urlencode 'mid=293793435' \
47 | --data-urlencode 'buvid=fuck_chenrui' \
48 | -b 'SESSDATA=xxx'
49 | ```
50 |
51 |
52 | 查看响应示例:
53 |
54 | ```json
55 | {
56 | "code": 0,
57 | "message": "0",
58 | "ttl": 1,
59 | "data": {
60 | "mid": 293793435,
61 | "device_name": "Chrome浏览器",
62 | "login_type": "扫码登录",
63 | "login_time": "2020-10-02 22:42:38",
64 | "location": "中国陕西渭南",
65 | "ip": "36.40.***.**"
66 | }
67 | }
68 | ```
69 |
70 |
71 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/message/im/notify.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.message.im;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | //
8 | service Notify {
9 | //
10 | rpc WatchNotify(google.protobuf.Empty) returns (stream NotifyRsp);
11 | }
12 |
13 | //
14 | enum PLType {
15 | //
16 | EN_PAYLOAD_NORMAL = 0;
17 | //
18 | EN_PAYLOAD_BASE64 = 1;
19 | }
20 |
21 | //
22 | enum CmdId {
23 | // 非法cmd
24 | EN_CMD_ID_INVALID = 0;
25 | // 服务端主动发起
26 | EN_CMD_ID_MSG_NOTIFY = 1;
27 | //
28 | EN_CMD_ID_KICK_OUT = 2;
29 | }
30 |
31 | //
32 | message NotifyRsp {
33 | //
34 | uint64 uid=1;
35 | // 命令id
36 | uint64 cmd=2;
37 | //
38 | bytes payload=3;
39 | //
40 | PLType payload_type=4;
41 | }
42 |
43 | //
44 | message Msg {
45 | // 发送方uid
46 | uint64 sender_uid = 1;
47 | // 接收方类型
48 | int32 receiver_type = 2;
49 | // 接收方id
50 | uint64 receiver_id = 3;
51 | // 客户端的序列id 用于服务端去重
52 | uint64 cli_msg_id = 4;
53 | // 消息类型
54 | int32 msg_type = 5;
55 | // 消息内容
56 | string content = 6;
57 | // 服务端的序列号
58 | uint64 msg_seqno = 7;
59 | // 消息发送时间(服务端时间)
60 | uint64 timestamp = 8;
61 | // at用户列表
62 | repeated uint64 at_uids = 9;
63 | // 多人消息
64 | repeated uint64 recver_ids = 10;
65 | // 消息唯一标示
66 | uint64 msg_key = 11;
67 | // 消息状态
68 | uint32 msg_status = 12;
69 | // 是否为系统撤销
70 | bool sys_cancel = 13;
71 | // 是否是多聊消息 目前群通知管理员的部分通知属于该类消息
72 | uint32 is_multi_chat = 14;
73 | // 表示撤回的消息的session_seqno 用以后续的比较 实现未读数的正确显示
74 | uint64 withdraw_seqno = 15;
75 | // 通知码
76 | string notify_code =16;
77 | // 消息来源
78 | uint32 msg_source = 17;
79 | }
80 |
81 | //
82 | message NotifyInfo {
83 | //
84 | uint32 msg_type = 1;
85 | //
86 | uint64 talker_id = 2;
87 | //
88 | uint32 session_type =3;
89 | }
90 |
91 | //
92 | message ReqServerNotify {
93 | // 最新序列号
94 | uint64 lastest_seqno = 1;
95 | // 即时消息 该类消息主要用于系统通知 当客户端sync msg时 不会sync到此类消息
96 | Msg instant_msg = 2;
97 | //
98 | NotifyInfo notify_info = 3;
99 | }
100 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/interfaces/v1/space.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.interfaces.v1;
4 |
5 | import "bilibili/app/archive/middleware/v1/preload.proto";
6 | import "bilibili/app/archive/v1/archive.proto";
7 | import "bilibili/app/dynamic/v2/dynamic.proto";
8 |
9 | //
10 | service Space {
11 | //
12 | rpc SearchTab(SearchTabReq) returns (SearchTabReply);
13 | //
14 | rpc SearchArchive(SearchArchiveReq) returns (SearchArchiveReply);
15 | //
16 | rpc SearchDynamic(SearchDynamicReq) returns (SearchDynamicReply);
17 | }
18 |
19 | //
20 | message Arc {
21 | //
22 | bilibili.app.archive.v1.Arc archive = 1;
23 | //
24 | string uri = 2;
25 | }
26 |
27 | //
28 | message Dynamic {
29 | //
30 | bilibili.app.dynamic.v2.DynamicItem dynamic = 1;
31 | }
32 |
33 | enum From {
34 | ArchiveTab = 0; //
35 | DynamicTab = 1; //
36 | }
37 |
38 | //
39 | message SearchTabReply {
40 | //
41 | int64 focus = 1;
42 | //
43 | repeated Tab tabs = 2;
44 | }
45 |
46 | //
47 | message SearchTabReq {
48 | //
49 | string keyword = 1;
50 | //
51 | int64 mid = 2;
52 | //
53 | int32 from = 3;
54 | }
55 |
56 | //
57 | message SearchArchiveReply {
58 | //
59 | repeated Arc archives = 1;
60 | //
61 | int64 total = 2;
62 | }
63 |
64 | //
65 | message SearchArchiveReq {
66 | //
67 | string keyword = 1;
68 | //
69 | int64 mid = 2;
70 | //
71 | int64 pn = 3;
72 | //
73 | int64 ps = 4;
74 | //
75 | bilibili.app.archive.middleware.v1.PlayerArgs player_args = 5;
76 | }
77 |
78 | //
79 | message SearchDynamicReply {
80 | //
81 | repeated Dynamic dynamics = 1;
82 | //
83 | int64 total = 2;
84 | }
85 |
86 | //
87 | message SearchDynamicReq {
88 | //
89 | string keyword = 1;
90 | //
91 | int64 mid = 2;
92 | //
93 | int64 pn = 3;
94 | //
95 | int64 ps = 4;
96 | //
97 | bilibili.app.archive.middleware.v1.PlayerArgs player_args = 5;
98 | }
99 |
100 | //
101 | message Tab {
102 | //
103 | string title = 1;
104 | //
105 | string uri = 2;
106 | }
107 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/polymer/community/govern/v1/govern.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.polymer.app.govern.v1;
4 |
5 | // 反骚扰
6 | service AntiHarassmentService {
7 | //
8 | rpc StoreAntiHarassmentSettings(StoreAntiHarassmentSettingsReq) returns (StoreAntiHarassmentSettingsRsp);
9 | //
10 | rpc LoadAntiHarassmentSettings(LoadAntiHarassmentSettingsReq) returns (LoadAntiHarassmentSettingsRsp);
11 | }
12 |
13 | //
14 | message AntiHarassmentInfo {
15 | //
16 | int32 limit = 1;
17 | //
18 | int32 follow_time_limit_second = 2;
19 | //
20 | int64 expire_time = 3;
21 | }
22 |
23 | //
24 | enum AntiHarassmentLimit {
25 | DefaultLimit = 0; //
26 | FollowLimit = 1; //
27 | ReFollowLimit = 2; //
28 | TwoWayFollow = 3; //
29 | AllLimit = 4; //
30 | }
31 |
32 | //
33 | message AntiHarassmentSetting {
34 | //
35 | int64 mid = 1;
36 | //
37 | bool auto_limit = 2;
38 | //
39 | AntiHarassmentInfo im = 3;
40 | //
41 | AntiHarassmentInfo reply = 4;
42 | //
43 | AntiHarassmentInfo dm = 5;
44 | //
45 | AntiHarassmentInfo reply_me = 6;
46 | //
47 | AntiHarassmentInfo like_me = 7;
48 | //
49 | AntiHarassmentInfo at_me = 8;
50 | //
51 | int64 auto_limit_expire_time = 9;
52 | }
53 |
54 | //
55 | enum BizType {
56 | InvalidBizType = 0; //
57 | Im = 1; //
58 | Dm = 2; //
59 | Reply = 3; //
60 | ReplyMe = 4; //
61 | LikeMe = 5; //
62 | AtMe = 6; //
63 | }
64 |
65 | //
66 | message LoadAntiHarassmentSettingsReq {
67 | //
68 | int32 biz_type = 1;
69 | //
70 | int64 recv_mid = 2;
71 | //
72 | int64 send_mid = 3;
73 | }
74 |
75 | //
76 | message LoadAntiHarassmentSettingsRsp {
77 | //
78 | bool anti_harassment_ret = 1;
79 | //
80 | AntiHarassmentSetting anti_harassment_setting = 2;
81 | //
82 | int32 show_window = 3;
83 | }
84 |
85 | //
86 | message StoreAntiHarassmentSettingsReq {
87 | //
88 | int32 biz_type = 1;
89 | //
90 | int64 mid = 2;
91 | //
92 | AntiHarassmentSetting anti_harassment_setting = 3;
93 | }
94 |
95 | //
96 | message StoreAntiHarassmentSettingsRsp {}
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/click/v1/heartbeat.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.click.v1;
4 |
5 | service Click {
6 |
7 | }
8 |
9 | // 账户信息
10 | message AccountInfo {
11 | //
12 | uint64 mid = 1;
13 | }
14 |
15 | //
16 | message AppInfo {
17 | //
18 | string top_page_class = 1;
19 | // 客户端首次启动时的毫秒时间戳
20 | int64 ftime = 2;
21 | //
22 | string did = 3;
23 | }
24 |
25 | // 心跳补充信息
26 | message Extra {
27 | //
28 | string session = 1;
29 | //
30 | string refer = 2;
31 | }
32 |
33 | message HeartBeatReply {}
34 |
35 | //
36 | message HeartBeatReq {
37 | //
38 | string session_v2 = 1;
39 | //
40 | Stage stage = 2;
41 | // 流加载失败timeout
42 | uint64 stream_timeout = 3;
43 | //
44 | uint64 batch_frequency = 4;
45 | //
46 | float frequency = 5;
47 | //
48 | VideoMeta video_meta = 6;
49 | //
50 | AppInfo app_info = 7;
51 | //
52 | AccountInfo account_info = 8;
53 | //
54 | PreProcessResult pre_process_result = 9;
55 | //
56 | repeated PlayerStatus player_status = 10;
57 | //
58 | VideoInfo video_info = 11;
59 | }
60 |
61 | //
62 | message PlayerStatus {
63 | //
64 | float playback_rate = 1;
65 | //
66 | uint64 progress = 2;
67 | //
68 | PlayState play_state = 3;
69 | //
70 | bool is_buffering = 4;
71 | }
72 |
73 | //
74 | enum PlayState {
75 | //
76 | STATE_UNKNOWN = 0;
77 | //
78 | PREPARING = 1;
79 | //
80 | PREPARED = 2;
81 | //
82 | PLAYING = 3;
83 | //
84 | PAUSED = 4;
85 | //
86 | STOPPED = 5;
87 | //
88 | FAILED = 6;
89 | }
90 |
91 | //
92 | message PreProcessResult {
93 | //
94 | int64 vt = 1;
95 | }
96 |
97 | //
98 | enum Stage {
99 | //
100 | STAGE_UNKNOWN = 0;
101 | //
102 | START = 1;
103 | //
104 | END = 2;
105 | //
106 | SAMPLE = 3;
107 | }
108 |
109 | //
110 | message VideoInfo {
111 | //
112 | uint64 cid_duration = 1;
113 | }
114 |
115 | //
116 | message VideoMeta {
117 | //
118 | uint64 aid = 1;
119 | //
120 | uint64 cid = 2;
121 | }
--------------------------------------------------------------------------------
/docs/video/pbp.md:
--------------------------------------------------------------------------------
1 | # 高能进度条
2 |
3 | 高能进度条反应了在时域上,单位时间内弹幕发送量的变化趋势
4 |
5 | 并用曲线顶点表示在进度条上,实现可视化
6 |
7 | ## 获取弹幕趋势顶点列表
8 |
9 | > https://bvc.bilivideo.com/pbp/data
10 |
11 | *请求方式:GET*
12 |
13 | **url参数:**
14 |
15 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
16 | | ------ | ---- | -------- | ------ | ---- |
17 | | cid | num | 视频cid | 必要 | |
18 | | aid | num | 稿件avid | 非必要 | |
19 | | bvid | num | 稿件bvid | 非必要 | |
20 |
21 | **json回复:**
22 |
23 | 根对象:
24 |
25 | | 字段 | 类型 | 内容 | 备注 |
26 | | -------- | ---- | ------------ | ---------------------------- |
27 | | step_sec | num | 采样间隔时间 | 单位为秒
由视频时长决定 |
28 | | tagstr | str | ??? | 作用尚不明确 |
29 | | events | obj | 数据本体 | |
30 | | debug | str | 调试信息 | json字串 |
31 |
32 | `events`对象:
33 |
34 | | 字段 | 类型 | 内容 | 备注 |
35 | | ------- | ------ | ---------- | ---- |
36 | | default | array | 顶点值列表 | |
37 |
38 | `events`对象中的数组:
39 |
40 | | 项 | 类型 | 内容 | 备注 |
41 | | ---- | ---- | --------- | -------------------------------- |
42 | | 0 | num | 顶点1 | |
43 | | n | num | 顶点(n+1) | 顶点个数由视频时长和采样时间决定 |
44 | | …… | num | …… | …… |
45 |
46 | **示例:**
47 |
48 | 获取视频`cid=3724723`的获取弹幕趋势顶点列表
49 |
50 | ```shell
51 | curl -G 'https://api.bilibili.com/pbp/data' \
52 | --data-urlencode 'cid=3724723'
53 | ```
54 |
55 |
56 | 查看响应示例:
57 |
58 | ```json
59 | {
60 | "step_sec": 3,
61 | "tagstr": "pbphide_0&client_&innersign_0&group_eg&nocheck_0&version_&pbphide_0",
62 | "events": {
63 | "default": [0, 8853, 8011, 8043.5, 8602.5, 9377, 18838, 9645, 10396, 10672.5, 10316.5, 9987, 9524, 9040, 9081, 8747, 8517, 8559.5, 8220.5, 8133, 7164, 5626, 4992, 4628.5, 4570.5, 4473.5, 4681.5, 4365.5, 3811.5, 3813, 3883, 4059.5, 4103.5, 4227.5, 4330.5, 4096.5, 4228.5, 4337, 5017, 5897, 6220, 5711.5, 4871.5, 4533, 4364, 3976, 4012, 3985, 3658, 3540, 3789, 3646, 3045, 2769, 2587, 2488.5, 2402.5, 2521.5, 2508.5, 2763.5, 2941.5, 3685.5, 3337.5, 2457, 2313, 2322.5, 2480.5, 2595, 2520, 2173.5, 2058.5, 2268.5, 2312.5, 2847, 1083, 1.5, 2.5, 0, 0, 2]
64 | },
65 | "debug": "{\"max_time\":237,\"zero_points_ratio\":0.025,\"total_dm\":1000,\"event_count\":400147}"
66 | }
67 | ```
68 |
69 |
70 |
--------------------------------------------------------------------------------
/assets/zone_icon/comic.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/login/login_action/readme.md:
--------------------------------------------------------------------------------
1 | # 登录操作
2 |
3 | 人机验证方式登录包含**账号密码登录**与手**机短信验证码登录**
4 |
5 | **注:扫码登录**不需要进行**人机验证**,故**不使用**以下接口
6 |
7 | ## 扫码登录
8 |
9 | - [扫码登录](QR.md)
10 |
11 | ## 验证登录
12 |
13 | 人机验证流程:
14 |
15 | 1. 请求验证码参数,得到登录密钥`key`与极验id`gt`和极验KEY`challenge`
16 | 2. 进行滑动or点击验证
17 | 3. 返回验证结果`validate`与`seccode`,进行短信或密码登录
18 |
19 |
20 | ### 申请captcha验证码
21 |
22 | > https://passport.bilibili.com/x/passport-login/captcha?source=main_web
23 |
24 | *请求方式:GET*
25 |
26 | **json回复:**
27 |
28 | 根对象:
29 |
30 | | 字段 | 类型 | 内容 | 备注 |
31 | | ------ | ---- | -------- | --------- |
32 | | code | num | 返回值 | 0:成功 |
33 | | message | str | 返回信息 | |
34 | | ttl | num | 1 | |
35 | | data | obj | 信息本体 | |
36 |
37 | `data`对象:
38 |
39 | | 字段 | 类型 | 内容 | 备注 |
40 | | -------- | ----- | ------ | -------- |
41 | | geetest | obj | 极验captcha数据 | |
42 | | tencent | obj | (?) | **作用尚不明确** |
43 | | token | str | 登录 API token | 与 captcha 无关,与登录接口有关 |
44 | | type | str | 验证方式 | 用于判断使用哪一种验证方式,目前所见只有极验
geetest:极验 |
45 |
46 | `geetest`对象:
47 |
48 | | 字段 | 类型 | 内容 | 备注 |
49 | | -------- | ----- | ------ | -------- |
50 | | gt | str | 极验id | 一般为固定值 |
51 | | challenge | str | 极验KEY | 由B站后端产生用于人机验证 |
52 |
53 | **示例:**
54 |
55 | ```shell
56 | curl 'https://passport.bilibili.com/x/passport-login/captcha?source=main_web'
57 | ```
58 |
59 |
60 | 查看响应示例:
61 |
62 | ```json
63 | {
64 | "code": 0,
65 | "message": "0",
66 | "ttl": 1,
67 | "data": {
68 | "type": "geetest",
69 | "token": "00fbe75cc2864ba0af969231f193a974",
70 | "geetest": {
71 | "challenge": "a57d9be17505d4a15ed84694c48fbf74",
72 | "gt": "ac597a4506fee079629df5d8b66dd4fe"
73 | },
74 | "tencent": {
75 | "appid": ""
76 | }
77 | }
78 | }
79 | ```
80 |
81 |
82 |
83 | ### 进行验证
84 |
85 | 本文档为 Bilibili 文档,验证码为 [geetest 极验](https://docs.geetest.com/sensebot/start/) 提供,故不提供相关 API
86 |
87 | 附: [手动验证器](https://kuresaru.github.io/geetest-validator/)
88 | [及其源码](https://github.com/kuresaru/geetest-validator)
89 |
90 | 1. 打开手动验证器,在1、2分别填入上面API返回的`gt`和`challenge`
91 | 2. 点击按钮3,稍等加载验证码,点击按钮4进行验证
92 | 3. 验证完成后,点击按钮5生成验证结果
93 | 4. 使用最开始获得到的`key`、`challenge`和刚获得到的`validate`、`seccode`继续之后的登录操作
94 |
95 |
96 | ### 继续登录
97 |
98 | - [短信登录](SMS.md)
99 | - [密码登录](password.md)
100 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/resource/v1/module.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.resource.v1;
4 |
5 | //
6 | service Module {
7 | //
8 | rpc List(ListReq) returns (ListReply);
9 | }
10 |
11 | //
12 | enum CompressType {
13 | Unzip = 0; // unzip
14 | Original = 1; // 不操作
15 | }
16 |
17 | //
18 | enum EnvType {
19 | Unknown = 0; //
20 | Release = 1; //
21 | Test = 2; //
22 | }
23 |
24 | //
25 | enum IncrementType {
26 | Total = 0; // 全量包
27 | Incremental = 1; // 增量包
28 | }
29 |
30 | //
31 | enum LevelType {
32 | Undefined = 0; //
33 | High = 1; // 高 需立即下载
34 | Middle = 2; // 中 可以延迟下载
35 | Low = 3; // 低 仅在业务方使用到时由业务方手动进行下载
36 | }
37 |
38 | message ListReply {
39 | //
40 | string env = 1;
41 | //
42 | repeated PoolReply pools = 2;
43 | //
44 | int64 list_version = 3;
45 | }
46 |
47 | //
48 | message ListReq {
49 | //
50 | string pool_name = 1;
51 | //
52 | string module_name = 2;
53 | //
54 | repeated VersionListReq version_list = 3;
55 | //
56 | EnvType env = 4;
57 | //
58 | int32 sys_ver = 5;
59 | //
60 | int32 scale = 6;
61 | //
62 | int32 arch = 7;
63 | //
64 | int64 list_version = 8;
65 | }
66 |
67 | //
68 | message ModuleReply {
69 | //
70 | string name = 1;
71 | //
72 | int64 version = 2;
73 | //
74 | string url = 3;
75 | //
76 | string md5 = 4;
77 | //
78 | string total_md5 = 5;
79 | //
80 | IncrementType increment = 6;
81 | //
82 | bool is_wifi = 7;
83 | //
84 | LevelType level = 8;
85 | //
86 | string filename = 9;
87 | //
88 | string file_type = 10;
89 | //
90 | int64 file_size = 11;
91 | //
92 | CompressType compress = 12;
93 | //
94 | int64 publish_time = 13;
95 | // 上报使用
96 | int64 pool_id = 14;
97 | //
98 | int64 module_id = 15;
99 | //
100 | int64 version_id = 16;
101 | //
102 | int64 file_id = 17;
103 | //
104 | bool zip_check = 18;
105 | }
106 |
107 | message PoolReply {
108 | //
109 | string name = 1;
110 | //
111 | repeated ModuleReply modules = 2;
112 | }
113 |
114 | //
115 | message VersionListReq {
116 | //
117 | string pool_name = 1;
118 | //
119 | repeated VersionReq versions = 2;
120 | }
121 |
122 | //
123 | message VersionReq {
124 | //
125 | string module_name = 1;
126 | //
127 | int64 version = 2;
128 | }
129 |
--------------------------------------------------------------------------------
/assets/zone_icon/douga.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/show/rank/v1/rank.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.show.v1;
4 |
5 | // 排行榜
6 | service Rank {
7 | // 全站排行榜
8 | rpc RankAll (RankAllResultReq) returns (RankListReply);
9 | // 分区排行榜
10 | rpc RankRegion (RankRegionResultReq) returns (RankListReply);
11 | }
12 |
13 | // 排行榜列表项
14 | message Item {
15 | // 标题
16 | string title = 1;
17 | // 封面url
18 | string cover = 2;
19 | // 参数(稿件avid)
20 | string param = 3;
21 | // 跳转uri
22 | string uri = 4;
23 | // 重定向url
24 | string redirect_url = 5;
25 | // 跳转类型
26 | // av:视频稿件
27 | string goto = 6;
28 | // 播放数
29 | int32 play = 7;
30 | // 弹幕数
31 | int32 danmaku = 8;
32 | // UP主mid
33 | int64 mid = 9;
34 | // UP主昵称
35 | string name = 10;
36 | // UP主头像url
37 | string face = 11;
38 | // 评论数
39 | int32 reply = 12;
40 | // 收藏数
41 | int32 favourite = 13;
42 | // 发布时间
43 | int64 pub_date = 14;
44 | // 分区tid
45 | int32 rid = 15;
46 | // 子分区名
47 | string rname = 16;
48 | // 视频总时长
49 | int64 duration = 17;
50 | // 点赞数
51 | int32 like = 18;
52 | // 1P cid
53 | int64 cid = 19;
54 | // 综合评分
55 | int64 pts = 20;
56 | // 合作视频文案
57 | string cooperation = 21;
58 | // 属性位
59 | // 0:未关注 1:已关注
60 | int32 attribute = 22;
61 | // UP主粉丝数
62 | int64 follower = 23;
63 | // UP主认证信息
64 | OfficialVerify official_verify = 24;
65 | // 同一UP收起子项列表
66 | repeated Item children = 25;
67 | // 关系信息
68 | Relation relation = 26;
69 | }
70 |
71 | // 认证信息
72 | message OfficialVerify {
73 | // 认证类型
74 | // -1:无认证 0:个人认证 1:机构认证
75 | int32 type = 1;
76 | // 认证描述
77 | string desc = 2;
78 | }
79 |
80 | // 全站排行榜-请求
81 | message RankAllResultReq {
82 | // 必须为"all"
83 | string order = 1;
84 | // 页码
85 | // 默认1页
86 | int32 pn = 2;
87 | // 每页项数
88 | // 默认100项,最大100
89 | int32 ps = 3;
90 | }
91 |
92 | // 排行榜信息-响应
93 | message RankListReply {
94 | // 排行榜列表
95 | repeated Item items = 1;
96 | }
97 |
98 | // 分区排行榜-请求
99 | message RankRegionResultReq {
100 | // 一级分区tid(二级分区不可用)
101 | // 0:全站
102 | int32 rid = 1;
103 | // 页码
104 | // 默认1页
105 | int32 pn = 2;
106 | // 每页项数
107 | // 默认100项,最大100
108 | int32 ps = 3;
109 | }
110 |
111 | // 关系信息
112 | message Relation {
113 | // 关系状态id
114 | // 1:未关注 2:已关注 3:被关注 4:互相关注
115 | int32 status = 1;
116 | // 是否关注
117 | int32 is_follow = 2;
118 | // 是否粉丝
119 | int32 is_followed = 3;
120 | }
--------------------------------------------------------------------------------
/docs/dynamic/action.md:
--------------------------------------------------------------------------------
1 | # 动态操作
2 |
3 | ## 删除动态
4 |
5 | > https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/rm_dynamic
6 |
7 | *请求方式:POST*
8 |
9 | 认证方式:Cookie(SESSDATA)
10 |
11 | **正文参数(multipart/form-data):**
12 |
13 | | 参数名 | 类型 | 内容 |
14 | | ---------- | ---- | ------ |
15 | | dynamic_id | num | 动态id |
16 | | csrf_token | str | csrf |
17 |
18 | **json回复:**
19 |
20 | 根对象:
21 |
22 | | 字段 | 类型 | 内容 |
23 | | ------- | ---- | ----------------- |
24 | | code | num | 0:成功 |
25 | | | | 500404:已经删除过 |
26 | | | | 500406:不是自己的 |
27 | | msg | str | 错误信息 |
28 | | message | str | 和msg一样 |
29 | | data | obj | 未知 |
30 |
31 |
32 | 查看示例
33 |
34 |
35 | ```bash
36 | curl 'https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/rm_dynamic' \
37 | -X POST \
38 | -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0' \
39 | -H 'Referer: https://t.bilibili.com/' \
40 | -H 'Cookie: SESSDATA=********; bili_jct=de2731532b4ab96bc8536da948932668;' \
41 | --data-raw 'dynamic_id=588320531406678918&csrf_token=de2731532b4ab96bc8536da948932668&csrf=de2731532b4ab96bc8536da948932668'
42 | ```
43 |
44 | ```json
45 | {
46 | "code":0,
47 | "msg":"",
48 | "message":"",
49 | "data": {
50 | "_gt_":0
51 | }
52 | }
53 | ```
54 |
55 |
56 |
57 | ## 删除草稿
58 |
59 | > https://api.vc.bilibili.com/dynamic_draft/v1/dynamic_draft/rm_draft
60 |
61 | *请求方式:POST*
62 |
63 | 认证方式:Cookie(SESSDATA)
64 |
65 | **正文参数(application/x-www-form-urlencoded):**
66 |
67 | | 参数名 | 类型 | 内容 |
68 | | ---------- | ---- | -------------- |
69 | | draft_id | num | 定时发送草稿id |
70 | | csrf_token | str | csrf |
71 |
72 | **json回复:**
73 |
74 | 根对象:
75 |
76 | | 字段 | 类型 | 内容 |
77 | | ------- | ---- | ---------------------------- |
78 | | code | num | 0:成功
4120015: 系统异常 |
79 | | message | str | 错误信息 |
80 | | ttl | num | 1 |
81 | | data | obj | 空对象 |
82 |
83 |
84 | 查看示例
85 |
86 |
87 | ```bash
88 | curl -X POST 'https://api.vc.bilibili.com/dynamic_draft/v1/dynamic_draft/rm_draft' \
89 | --data-urlencode 'draft_id=755409289278914611' \
90 | --data-urlencode 'csrf=xxxx'
91 | -b 'SESSDATA=xxxx;' \
92 | ```
93 |
94 | ```json
95 | {
96 | "code": 0,
97 | "message": "0",
98 | "ttl": 1,
99 | "data": {}
100 | }
101 | ```
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/show/popular/v1/popular.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.show.v1;
4 |
5 | import "bilibili/app/card/v1/card.proto";
6 | import "bilibili/app/archive/middleware/v1/preload.proto";
7 |
8 | // 热门
9 | service Popular {
10 | // 热门列表
11 | rpc Index (PopularResultReq) returns (PopularReply);
12 | }
13 |
14 | // 气泡信息
15 | message Bubble {
16 | // 文案
17 | string bubble_content = 1;
18 | // 版本
19 | int32 version = 2;
20 | // 起始时间
21 | int64 stime = 3;
22 | }
23 |
24 | // 配置信息
25 | message Config {
26 | // 标题
27 | string item_title = 1;
28 | // 底部文案
29 | string bottom_text = 2;
30 | // 底部图片url
31 | string bottom_text_cover = 3;
32 | // 底部跳转页url
33 | string bottom_text_url = 4;
34 | // 顶部按钮信息列表
35 | repeated EntranceShow top_items = 5;
36 | // 头图url
37 | string head_image = 6;
38 | // 当前页按钮信息
39 | repeated EntranceShow page_items = 7;
40 | //
41 | int32 hit = 8;
42 | }
43 |
44 | // 按钮信息
45 | message EntranceShow {
46 | // 按钮图标url
47 | string icon = 1;
48 | // 按钮名
49 | string title = 2;
50 | // 入口模块id
51 | string module_id = 3;
52 | // 跳转uri
53 | string uri = 4;
54 | // 气泡信息
55 | Bubble bubble = 5;
56 | // 入口id
57 | int64 entrance_id = 6;
58 | // 头图url
59 | string top_photo = 7;
60 | // 入口类型
61 | int32 entrance_type = 8;
62 | }
63 |
64 | // 热门列表-响应
65 | message PopularReply {
66 | // 卡片列表
67 | repeated bilibili.app.card.v1.Card items = 1;
68 | // 配置信息
69 | Config config = 2;
70 | // 版本
71 | string ver = 3;
72 | }
73 |
74 | // 热门列表-请求
75 | message PopularResultReq {
76 | // 排位索引id,为上此请求末尾项的idx
77 | int64 idx = 1;
78 | // 登录标识
79 | // 1:未登陆用户第一页 2:登陆用户第一页
80 | int32 login_event = 2;
81 | // 清晰度(旧版)
82 | int32 qn = 3;
83 | // 视频流版本(旧版)
84 | int32 fnver = 4;
85 | // 视频流功能(旧版)
86 | int32 fnval = 5;
87 | // 是否强制使用域名(旧版)
88 | int32 force_host = 6;
89 | // 是否4K(旧版)
90 | int32 fourk = 7;
91 | // 当前页面spm
92 | string spmid = 8;
93 | // 上此请求末尾项的param
94 | string last_param = 9;
95 | // 上此请求的ver
96 | string ver = 10;
97 | // 分品类热门的入口ID
98 | int64 entrance_id = 11;
99 | // 热门定位id集合
100 | string location_ids = 12;
101 | // 0:tag页 1:中间页
102 | int32 source_id = 13;
103 | // 数据埋点上报
104 | // 0:代表手动刷新 1:代表自动刷新
105 | int32 flush = 14;
106 | // 秒开参数
107 | bilibili.app.archive.middleware.v1.PlayerArgs player_args = 15;
108 | }
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/docs/web_widget/zone_upload.md:
--------------------------------------------------------------------------------
1 | # 分区当日投稿数
2 |
3 | ## 获取分区当日投稿稿件数
4 |
5 | > https://api.bilibili.com/x/web-interface/online
6 |
7 | *请求方式:GET*
8 |
9 | **json回复:**
10 |
11 | 根对象:
12 |
13 | | 字段 | 类型 | 内容 | 备注 |
14 | | ------- | ---- | -------- | ------- |
15 | | code | num | 返回值 | 0:成功 |
16 | | message | str | 错误信息 | 默认为0 |
17 | | ttl | num | 1 | |
18 | | data | obj | 信息本体 | |
19 |
20 | `data`对象:
21 |
22 | | 字段 | 类型 | 内容 | 备注 |
23 | | ------------ | ---- | ---------------- | ---- |
24 | | region_count | obj | 分区当日投稿稿件数信息 | |
25 |
26 | `data`中的`region_count`对象:
27 |
28 | | 字段 | 类型 | 内容 | 备注 |
29 | | ---- | ---- | ------------------------- | ---- |
30 | | 1 | num | 当日投稿稿件数-动画(主分区) | |
31 | | 13 | num | 当日投稿稿件数-番剧(主分区) | |
32 | | 167 | num | 当日投稿稿件数-国创(主分区) | |
33 | | 3 | num | 当日投稿稿件数-音乐(主分区) | |
34 | | 129 | num | 当日投稿稿件数-舞蹈(主分区) | |
35 | | 4 | num | 当日投稿稿件数-游戏(主分区) | |
36 | | 17 | num | 当日投稿稿件数-单机游戏 | |
37 | | 36 | num | 当日投稿稿件数-知识(主分区) | |
38 | | 188 | num | 当日投稿稿件数-数码(主分区) | |
39 | | 160 | num | 当日投稿稿件数-生活(主分区) | |
40 | | 138 | num | 当日投稿稿件数-搞笑 | |
41 | | 76 | num | 当日投稿稿件数-美食圈 | |
42 | | 75 | num | 当日投稿稿件数-动物圈 | |
43 | | 119 | num | 当日投稿稿件数-鬼畜(主分区) | |
44 | | 155 | num | 当日投稿稿件数-时尚(主分区) | |
45 | | 202 | num | 当日投稿稿件数-资讯(主分区) | |
46 | | 165 | num | 当日投稿稿件数-广告(主分区) | |
47 | | 5 | num | 当日投稿稿件数-娱乐(主分区) | |
48 | | 181 | num | 当日投稿稿件数-影视(主分区) | |
49 | | 177 | num | 当日投稿稿件数-纪录片(主分区) | |
50 | | 23 | num | 当日投稿稿件数-电影(主分区) | |
51 | | 11 | num | 当日投稿稿件数-电视剧(主分区) | |
52 |
53 | **示例:**
54 |
55 | ```shell
56 | curl 'https://api.bilibili.com/x/web-interface/online'
57 | ```
58 |
59 |
60 | 查看响应示例:
61 |
62 | ```json
63 | {
64 | "code": 0,
65 | "message": "0",
66 | "ttl": 1,
67 | "data": {
68 | "region_count": {
69 | "1": 28,
70 | "11": 0,
71 | "119": 0,
72 | "129": 13,
73 | "13": 2,
74 | "138": 21,
75 | "155": 13,
76 | "160": 215,
77 | "165": 0,
78 | "167": 3,
79 | "17": 86,
80 | "177": 0,
81 | "181": 61,
82 | "188": 5,
83 | "202": 0,
84 | "23": 0,
85 | "3": 67,
86 | "36": 27,
87 | "4": 235,
88 | "5": 33,
89 | "75": 12,
90 | "76": 17
91 | }
92 | }
93 | }
94 | ```
95 |
96 |
97 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/splash/v1/splash.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.splash.v1;
4 |
5 | import "google/protobuf/any.proto";
6 |
7 | //
8 | service Splash {
9 | //
10 | rpc List (SplashReq) returns (SplashReply);
11 | }
12 |
13 | //
14 | message ShowStrategy {
15 | //
16 | int32 id = 1;
17 | //
18 | int64 stime = 2;
19 | //
20 | int64 etime = 3;
21 | }
22 |
23 | //
24 | message SplashItem {
25 | //
26 | int32 id = 1;
27 | //
28 | int32 type = 2;
29 | //
30 | int32 card_type = 3;
31 | //
32 | int32 duration = 4;
33 | //
34 | int64 begin_time = 5;
35 | //
36 | int64 end_time = 6;
37 | //
38 | string thumb = 7;
39 | //
40 | string hash = 8;
41 | //
42 | string logo_url = 9;
43 | //
44 | string logo_hash = 10;
45 | //
46 | string video_url = 11;
47 | //
48 | string video_hash = 12;
49 | //
50 | int32 video_width = 13;
51 | //
52 | int32 video_height = 14;
53 | //
54 | string schema = 15;
55 | //
56 | string schema_title = 16;
57 | //
58 | string schema_package_name = 17;
59 | //
60 | repeated string schema_callup_whiteList = 18;
61 | //
62 | int32 skip = 19;
63 | //
64 | string uri = 20;
65 | //
66 | string uri_title = 21;
67 | //
68 | int32 source = 22;
69 | //
70 | int32 cm_mark = 23;
71 | //
72 | string ad_cb = 24;
73 | //
74 | int64 resource_id = 25;
75 | //
76 | string request_id = 26;
77 | //
78 | string client_ip = 27;
79 | //
80 | bool is_ad = 28;
81 | //
82 | bool is_ad_loc = 29;
83 | //
84 | google.protobuf.Any extra = 30;
85 | //
86 | int64 card_index = 31;
87 | //
88 | int64 server_type = 32;
89 | //
90 | int64 index = 33;
91 | //
92 | string click_url = 34;
93 | //
94 | string show_url = 35;
95 | //
96 | int32 time_target = 36;
97 | //
98 | int32 encryption = 37;
99 | //
100 | bool enable_pre_download = 38;
101 | //
102 | bool enable_background_download = 39;
103 | }
104 |
105 | //-响应
106 | message SplashReply {
107 | //
108 | int32 max_time = 1;
109 | //
110 | int32 min_interval = 2;
111 | //
112 | int32 pull_interval = 3;
113 | //
114 | repeated SplashItem list = 4;
115 | //
116 | repeated ShowStrategy show = 5;
117 | }
118 |
119 | //-请求
120 | message SplashReq {
121 | //
122 | int32 width = 1;
123 | //
124 | int32 height = 2;
125 | //
126 | string birth = 3;
127 | //
128 | string ad_extra = 4;
129 | //
130 | string network = 5;
131 | }
132 |
--------------------------------------------------------------------------------
/docs/user/check_nickname.md:
--------------------------------------------------------------------------------
1 | # 检查昵称是否可注册
2 |
3 | ## 检查昵称
4 |
5 | > https://passport.bilibili.com/web/generic/check/nickname
6 |
7 | *请求方式:GET*
8 |
9 | 也可用于判断指定昵称的用户是否存在
10 |
11 | **url参数:**
12 |
13 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
14 | | -------- | ---- | ----------- | ------ | ---- |
15 | | nickName | str | 目标昵称 | 必要 | 最长为16字符 |
16 |
17 | **json回复:**
18 |
19 | 根对象:
20 |
21 | | 字段 | 类型 | 内容 | 备注 |
22 | | ------- | ---- | -------- | --------------------------- |
23 | | code | num | 状态码 | -400:请求错误
-500:服务器端异常
**详细说明见下一表格** |
24 | | message | str | 错误详情 | 若昵称可用,则不返回message |
25 |
26 | `code`状态码:
27 |
28 | | 值 | 含义 |
29 | | ----- | --------------------------------- |
30 | | 0 | 昵称未被注册 |
31 | | 2001 | 该昵称已被他人使用 |
32 | | 40002 | 昵称包含敏感信息 |
33 | | 40004 | 昵称不可包含除\-和_以外的特殊字符 |
34 | | 40005 | 昵称过长(超过16字符) |
35 | | 40006 | 昵称过短(少于2字符) |
36 | | 40014 | 昵称已存在 |
37 |
38 | **示例:**
39 |
40 | 查询昵称 `xijinping` 是否被使用:
41 |
42 | ```shell
43 | curl -G 'https://passport.bilibili.com/web/generic/check/nickname' \
44 | --data-urlencode 'nickName=xijinping'
45 | ```
46 |
47 |
48 | 查看响应示例:
49 |
50 | ```json
51 | {
52 | "code":40002,
53 | "message":"昵称包含敏感信息"
54 | }
55 | ```
56 |
57 |
58 |
59 | 查询昵称 `//` 是否被使用:
60 |
61 | ```shell
62 | curl -G 'https://passport.bilibili.com/web/generic/check/nickname' \
63 | --data-urlencode 'nickName=//'
64 | ```
65 |
66 |
67 | 查看响应示例:
68 |
69 | ```json
70 | {
71 | "code": 40004,
72 | "message": "昵称不可包含除-和_以外的特殊字符"
73 | }
74 | ```
75 |
76 |
77 |
78 | 查询昵称 `test0000000000000 ` 是否被使用:
79 |
80 | ```shell
81 | curl -G 'https://passport.bilibili.com/web/generic/check/nickname' \
82 | --data-urlencode 'nickName=test0000000000000 '
83 | ```
84 |
85 |
86 | 查看响应示例:
87 |
88 | ```json
89 | {
90 | "code": 40005,
91 | "message": "昵称过长"
92 | }
93 | ```
94 |
95 |
96 |
97 | 查询昵称 `0` 是否被使用:
98 |
99 | ```shell
100 | curl -G 'https://passport.bilibili.com/web/generic/check/nickname' \
101 | --data-urlencode 'nickName=0'
102 | ```
103 |
104 |
105 | 查看响应示例:
106 |
107 | ```json
108 | {
109 | "code": 40006,
110 | "message": "昵称过短"
111 | }
112 | ```
113 |
114 |
115 |
116 | 查询昵称 `test` 是否被使用:
117 |
118 | ```shell
119 | curl -G 'https://passport.bilibili.com/web/generic/check/nickname' \
120 | --data-urlencode 'nickName=test'
121 | ```
122 |
123 |
124 | 查看响应示例:
125 |
126 | ```json
127 | {
128 | "code":40014,
129 | "message":"昵称已存在"
130 | }
131 | ```
132 |
133 |
134 |
--------------------------------------------------------------------------------
/assets/zone_icon/ent.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/zone_icon/food.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/v1/broadcast.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.v1;
4 |
5 | import "bilibili/rpc/status.proto";
6 | import "google/protobuf/any.proto";
7 | import "google/protobuf/empty.proto";
8 |
9 | // broadcast操作,对应每个target_path
10 | service Broadcast {
11 | // 用户鉴权
12 | rpc Auth(AuthReq) returns (AuthResp);
13 | // 心跳保活:成功心跳为4分45秒,重试心跳为30s,三次收不到进行重连(不超过5分45)
14 | rpc Heartbeat(HeartbeatReq) returns (HeartbeatResp);
15 | // 订阅target_path
16 | rpc Subscribe(TargetPath) returns (google.protobuf.Empty);
17 | // 取消订阅target_path
18 | rpc Unsubscribe(TargetPath) returns (google.protobuf.Empty);
19 | // 消息回执
20 | rpc MessageAck(MessageAckReq) returns (google.protobuf.Empty);
21 | }
22 |
23 | // broadcast连接隧道
24 | service BroadcastTunnel {
25 | // 创建双向stream连接隧道
26 | rpc CreateTunnel(stream BroadcastFrame) returns (stream BroadcastFrame);
27 | }
28 |
29 | //
30 | enum Action {
31 | UNKNOWN = 0; //
32 | UPDATE = 1; //
33 | DELETE = 2; //
34 | }
35 |
36 | // 鉴权请求,通过authorization验证绑定用户mid
37 | message AuthReq {
38 | // 冷启动id,算法uuid,重新起启会变
39 | string guid = 1;
40 | // 连接id,算法uuid,重连会变
41 | string conn_id = 2;
42 | // 最后收到的消息id,用于过虑重连后获取未读的消息
43 | int64 last_msg_id = 3;
44 | }
45 |
46 | // 鉴权返回
47 | message AuthResp {
48 |
49 | }
50 |
51 | // target_path:
52 | // "/" Service-Name "/" {method name} 参考 gRPC Request Path
53 | message BroadcastFrame {
54 | // 请求消息信息
55 | FrameOption options = 1;
56 | // 业务target_path
57 | string target_path = 2;
58 | // 业务pb内容
59 | google.protobuf.Any body = 3;
60 | }
61 |
62 | // message_id:
63 | // client: 本次连接唯一的消息id,可用于回执
64 | // server: 唯一消息id,可用于上报或者回执
65 | // sequence:
66 | // client: 客户端应该每次请求时frame seq++,会返回对应的对称req/resp
67 | // server: 服务端下行消息,只会返回默认值:0
68 | message FrameOption {
69 | // 消息id
70 | int64 message_id = 1;
71 | // frame序号
72 | int64 sequence = 2;
73 | // 是否进行消息回执(发出MessageAckReq)
74 | // downstream 上只有服务端设置为true,客户端响应
75 | // upstream 上只有客户端设置为true,服务端响应
76 | // 响应帧禁止设置is_ack,协议上禁止循环
77 | // 通常只有业务帧才可能设置is_ack, 因为协议栈(例如心跳、鉴权)另有响应约定
78 | bool is_ack = 3;
79 | // 业务状态码
80 | bilibili.rpc.Status status = 4;
81 | // 业务ack来源, 仅downstream时候由服务端填写.
82 | string ack_origin = 5;
83 | //
84 | int64 timestamp = 6;
85 | }
86 |
87 | // 心跳请求
88 | message HeartbeatReq{
89 |
90 | }
91 |
92 | // 心跳返回
93 | message HeartbeatResp{
94 |
95 | }
96 |
97 | // 消息回执
98 | message MessageAckReq {
99 | // 消息id
100 | int64 ack_id = 1;
101 | // ack来源,由业务指定用于埋点跟踪
102 | string ack_origin = 2;
103 | // 消息对应的target_path,方便业务区分和监控统计
104 | string target_path = 3;
105 | }
106 |
107 | // target_path
108 | message TargetPath {
109 | // 需要订阅的target_paths
110 | repeated string target_paths = 1;
111 | }
112 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/broadcast/v1/push.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.broadcast.v1;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | // Push
8 | service Push {
9 | rpc WatchMessage(google.protobuf.Empty) returns (stream PushMessageResp);
10 | }
11 |
12 | //
13 | enum LinkType {
14 | LINK_TYPE_UNKNOWN = 0; // 未知
15 | LINK_TYPE_BANGUMI = 1; // 番剧
16 | LINK_TYPE_VIDEO = 2; // 视频
17 | LINK_TYPE_LIVE = 3; // 直播
18 | }
19 |
20 | //
21 | message PageBlackList {
22 | //
23 | string id = 1;
24 | }
25 |
26 | //
27 | message PageView {
28 | //
29 | string id = 1;
30 | }
31 |
32 | //
33 | message PushMessageResp {
34 | // 业务类型
35 | enum Biz {
36 | // 未知
37 | BIZ_UNKNOWN = 0;
38 | // 视频
39 | BIZ_VIDEO = 1;
40 | // 直播
41 | BIZ_LIVE = 2;
42 | // 活动
43 | BIZ_ACTIVITY = 3;
44 | }
45 | // 消息类型
46 | enum Type {
47 | // 未知
48 | TYPE_UNKNOWN = 0;
49 | // 默认
50 | TYPE_DEFAULT = 1;
51 | // 热门
52 | TYPE_HOT = 2;
53 | // 实时
54 | TYPE_REALTIME = 3;
55 | // 推荐
56 | TYPE_RECOMMEND = 4;
57 | }
58 | // 展示未知
59 | enum Position {
60 | // 未知
61 | POS_UNKNOWN = 0;
62 | // 顶部
63 | POS_TOP = 1;
64 | }
65 | // Deprecated: 推送任务id,使用string
66 | int64 old_taskid = 1;
67 | // 业务
68 | // 1:是视频 2:是直播 3:是活动
69 | Biz biz = 2;
70 | // 类型
71 | // 1:是默认 2:是热门 3:是实时 4:是推荐
72 | Type type = 3;
73 | // 主标题
74 | string title = 4;
75 | // 副标题
76 | string summary = 5;
77 | // 图片地址
78 | string img = 6;
79 | // 跳转地址
80 | string link = 7;
81 | // 展示位置,1是顶部
82 | Position position = 8;
83 | // 展示时长(单位:秒),默认3秒
84 | int32 duration = 9;
85 | // 失效时间
86 | int64 expire = 10;
87 | // 推送任务id
88 | string taskid = 11;
89 | // 应用内推送黑名单
90 | // UGC: ugc-video-detail
91 | // PGC: pgc-video-detail
92 | // 一起看: pgc-video-detail-theater
93 | // 直播: live-room-detail
94 | // Story: ugc-video-detail-vertical
95 | // 播单黑名单 playlist-video-detail
96 | repeated PageBlackList page_blackList = 12;
97 | // 预留pvid
98 | repeated PageView page_view = 13;
99 | // 跳转资源
100 | TargetResource target_resource = 14;
101 | //
102 | int32 image_frame = 15;
103 | //
104 | int32 image_marker = 16;
105 | //
106 | int32 image_position = 17;
107 | //
108 | int64 job = 18;
109 | }
110 |
111 | //
112 | message TargetResource {
113 | //直播: roomid
114 | //UGC: avid
115 | //PGC: seasonid
116 | //Story: avid
117 | //举个例子
118 | //Type: LINK_TYPE_BANGUMI (番剧)
119 | //Resource: {"seasonid":"123"}
120 | //
121 | //Type: LINK_TYPE_VIDEO (视频)
122 | //Resource: {"avid":"123"}
123 | //
124 | //Type: LINK_TYPE_LIVE (直播)
125 | //Resource: {"roomid":"123"}
126 | //
127 | LinkType Type = 1;
128 | //
129 | map Resource = 2;
130 | }
131 |
--------------------------------------------------------------------------------
/docs/clientinfo/client_info.md:
--------------------------------------------------------------------------------
1 | # 终端信息查询
2 |
3 | ## 终端信息查询
4 |
5 | > https://api.bilibili.com/client_info
6 |
7 | *请求方式:任意*
8 |
9 | **json回复:**
10 |
11 | 根对象:
12 |
13 | | 字段 | 类型 | 内容 | 备注 |
14 | | ------- | ---- | -------- | ------- |
15 | | code | num | 返回值 | 0:成功 |
16 | | message | str | 错误信息 | 默认为0 |
17 | | ttl | num | 1 | |
18 | | data | obj | 信息本体 | |
19 |
20 | `data`对象:
21 |
22 | | 字段 | 类型 | 内容 | 备注 |
23 | | -------- | -------- | ------------------- | ------------ |
24 | | country | str | 国家/地区名 | |
25 | | ip | str | 公网IP地址 | |
26 | | province | str | 省/州 | 非必须存在项 |
27 | | city | str | 城市 | 非必须存在项 |
28 | | district | district | ? | |
29 | | isp | str | 运营商名 | |
30 | | dns | str | dns服务器ip | |
31 | | dns_isp | str | dns服务器ip运营商名 | |
32 | | headers | obj | 头部字段 | |
33 |
34 | `data`中的`headers`对象:
35 |
36 | | 字段 | 类型 | 内容 | 备注 |
37 | | --------------------------------- | ---- | ----------------- | ---- |
38 | | HTTP_ACCEPT_ENCODING | str | | |
39 | | HTTP_X_CACHE_SERVER | str | CDN服务器名 | |
40 | | HTTP_X_CACHE_SERVER_ADDR | str | CDN服务器ip | |
41 | | HTTP_X_BACKEND_BILI_REAL_IP | str | 真实服务器ip | |
42 | | HTTP_X_BACKEND_BILI_REAL_IPPORT | str | 真实服务器端口 | |
43 | | HTTP_X_BACKEND_BILI_REAL_IP_CHAIN | str | 真实服务器ip+端口 | |
44 | | HTTP_X_SCHEME | str | 访问协议 | |
45 | | HTTP_HOST | str | 访问域名 | |
46 | | HTTP_USER_AGENT | str | 客户端UA | |
47 | | HTTP_ACCEPT | str | | |
48 | | HTTP_CACHE_CONTROL | str | | |
49 |
50 | **示例:**
51 |
52 | ```shell
53 | curl 'https://api.bilibili.com/client_info'
54 | ```
55 |
56 |
57 | 查看响应示例:
58 |
59 |
60 | ```json
61 | {
62 | "code": 0,
63 | "message": "ok",
64 | "data": {
65 | "country": "中国",
66 | "ip": "36.40.120.140",
67 | "province": "陕西",
68 | "city": "渭南",
69 | "district": null,
70 | "isp": "电信",
71 | "dns": null,
72 | "dns_isp": null,
73 | "headers": {
74 | "HTTP_ACCEPT_ENCODING": "gzip",
75 | "HTTP_X_CACHE_SERVER": "ks-bj-webcdn-07",
76 | "HTTP_X_CACHE_SERVER_ADDR": "10.33.2.170",
77 | "HTTP_X_BACKEND_BILI_REAL_IP": "36.40.120.140",
78 | "HTTP_X_BACKEND_BILI_REAL_IPPORT": "22058",
79 | "HTTP_X_BACKEND_BILI_REAL_IP_CHAIN": "36.40.120.140:22058",
80 | "HTTP_X_SCHEME": "https",
81 | "HTTP_HOST": "api.bilibili.com",
82 | "HTTP_USER_AGENT": "PostmanRuntime/7.26.8",
83 | "HTTP_ACCEPT": "*/*",
84 | "HTTP_CACHE_CONTROL": "no-cache"
85 | }
86 | }
87 | }
88 | ```
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/docs/bangumi/follow.md:
--------------------------------------------------------------------------------
1 | # 追番相关
2 |
3 | ## 追番
4 | > https://api.bilibili.com/pgc/web/follow/add
5 |
6 | *请求方式:POST*
7 |
8 | 鉴权方式:Cookie(SESSDATA)
9 |
10 | **url参数:**
11 |
12 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
13 | |----------|-----|--------|-----|-----|
14 | | season_id | str | 剧集ssid | 必要 | |
15 | | csrf | str | csrf token(位于cookies中的bili_jct) | 必要 | |
16 |
17 | **json回复:**
18 |
19 | 根对象:
20 |
21 | | 字段 | 类型 | 内容 | 备注 |
22 | | ------- | ---- | ------ | ------------------------------- |
23 | | code | num | 返回值 | 0:成功
-111:csrf校验失败 |
24 | | message | str | 信息 | 成功时:success |
25 | | result | obj |见下表| |
26 |
27 | 根对象中的`result`对象:
28 |
29 | | 字段 | 类型 | 内容 | 备注 |
30 | | -------- | ---- | ---------- | ---- |
31 | | fmid | num | 0 | |
32 | | relation | bool | false | |
33 | | status | num | 2 | |
34 | | toast | str | 自己追的番就要好好看完哟^o^ | |
35 |
36 | **示例:**
37 |
38 | 追番`ssid=41410`的番剧
39 |
40 | ```shell
41 | curl -G 'https://api.bilibili.com/pgc/web/follow/add' \
42 | --data-urlencode 'season_id=41410' \
43 | --data-urlencode 'csrf=xxx' \
44 | ```
45 |
46 |
47 |
48 | 查看响应示例:
49 |
50 | ```json
51 | {
52 | "code": 0,
53 | "message": "success",
54 | "result": {
55 | "fmid": 0,
56 | "relation": false,
57 | "status": 2,
58 | "toast": "自己追的番就要好好看完哟^o^"
59 | }
60 | }
61 | ```
62 |
63 |
64 | ## 取消追番
65 |
66 | > https://api.bilibili.com/pgc/web/follow/del
67 |
68 | *请求方式:POST*
69 |
70 | 鉴权方式:Cookie(SESSDATA)
71 |
72 | **url参数:**
73 |
74 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
75 | | --------- | ---- | ----------------------------------- | ------ | ---- |
76 | | season_id | str | 剧集ssid | 必要 | |
77 | | csrf | str | csrf token(位于cookies中的bili_jct) | 必要 | |
78 |
79 | **json回复:**
80 |
81 | 根对象:
82 |
83 | | 字段 | 类型 | 内容 | 备注 |
84 | | ------- | ---- | ------ | ------------------------------- |
85 | | code | num | 返回值 | 0:成功
-111:csrf校验失败 |
86 | | message | str | 信息 | 成功时:success |
87 | | result | obj | 见下表 | |
88 |
89 | 根对象中的`result`对象:
90 |
91 | | 字段 | 类型 | 内容 | 备注 |
92 | | -------- | ---- | ---------- | ---- |
93 | | fmid | num | 0 | |
94 | | relation | bool | true | |
95 | | status | num | 0 | |
96 | | toast | str | 已取消追番 | |
97 |
98 | **示例:**
99 |
100 | 取消`ssid=41410`的追番
101 |
102 | ```shell
103 | curl -G 'https://api.bilibili.com/pgc/web/follow/del' \
104 | --data-urlencode 'season_id=41410' \
105 | --data-urlencode 'csrf=xxx' \
106 | ```
107 |
108 |
109 |
110 | 查看响应示例:
111 |
112 | ```json
113 | {
114 | "code": 0,
115 | "message": "success",
116 | "result": {
117 | "fmid": 0,
118 | "relation": false,
119 | "status": 0,
120 | "toast": "已取消追番"
121 | }
122 | }
123 | ```
124 |
125 |
--------------------------------------------------------------------------------
/docs/emoji/action.md:
--------------------------------------------------------------------------------
1 | # 表情操作
2 |
3 | ## 添加表情包
4 |
5 | > https://api.bilibili.com/x/emote/package/add
6 |
7 | *请求方式:POST*
8 |
9 | 认证方式:Cookie(SESSDATA)
10 |
11 | 只能添加有会员权限或已购买的表情包
12 |
13 | **正文参数( application/x-www-form-urlencoded ):**
14 |
15 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
16 | | ---------- | ---- | ------------------------ | ------ | -------------------------------- |
17 | | package_id | num | 表情包id | 必要 | |
18 | | business | str | 使用场景 | 必要 | reply:评论区
dynamic:动态 |
19 | | csrf | str | CSRF Token(位于cookie) | 必要 | |
20 |
21 | **json回复:**
22 |
23 | 根对象:
24 |
25 | | 字段 | 类型 | 内容 | 备注 |
26 | | ------- | ---- | -------- | ------------------------------------------------------------ |
27 | | code | num | 返回值 | 0:成功
-101:账号未登录
-111:csrf校验失败
-400:请求错误
-403:访问权限不足 |
28 | | message | str | 错误信息 | 默认为0 |
29 | | ttl | num | 1 | |
30 |
31 | **示例:**
32 |
33 | 添加id为`25`的表情包,使用场景为评论区
34 |
35 | ```shell
36 | curl 'https://api.bilibili.com/x/emote/package/add' \
37 | --data-urlencode 'package_id=25' \
38 | --data-urlencode 'business=reply' \
39 | --data-urlencode 'csrf=xxx' \
40 | -b 'SESSDATA=xxx'
41 | ```
42 |
43 |
44 | 查看响应示例:
45 |
46 | ```json
47 | {
48 | "code": 0,
49 | "message": "0",
50 | "ttl": 1
51 | }
52 | ```
53 |
54 |
55 |
56 | ## 移除表情包
57 |
58 | > https://api.bilibili.com/x/emote/package/remove
59 |
60 | *请求方式:POST*
61 |
62 | 认证方式:Cookie(SESSDATA)
63 |
64 | **正文参数( application/x-www-form-urlencoded ):**
65 |
66 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
67 | | ---------- | ---- | ------------------------ | ------ | -------------------------------- |
68 | | package_id | num | 表情包id | 必要 | |
69 | | business | str | 使用场景 | 必要 | reply:评论区
dynamic:动态 |
70 | | csrf | str | CSRF Token(位于cookie) | 必要 | |
71 |
72 | **json回复:**
73 |
74 | 根对象:
75 |
76 | | 字段 | 类型 | 内容 | 备注 |
77 | | ------- | ---- | -------- | ------------------------------------------------------------ |
78 | | code | num | 返回值 | 0:成功
-101:账号未登录
-111:csrf校验失败
-400:请求错误
-403:访问权限不足 |
79 | | message | str | 错误信息 | 默认为0 |
80 | | ttl | num | 1 | |
81 |
82 | **示例:**
83 |
84 | 移除id为`25`的表情包,使用场景为评论区
85 |
86 | ```shell
87 | curl 'https://api.bilibili.com/x/emote/package/remove' \
88 | --data-urlencode 'package_id=25' \
89 | --data-urlencode 'business=reply' \
90 | --data-urlencode 'csrf=xxx' \
91 | -b 'SESSDATA=xxx'
92 | ```
93 |
94 |
95 | 查看响应示例:
96 |
97 | ```json
98 | {
99 | "code": 0,
100 | "message": "0",
101 | "ttl": 1
102 | }
103 | ```
104 |
105 |
106 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/app/distribution/v1/distribution.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.app.distribution.v1;
4 |
5 | // APP配置
6 | service Distribution {
7 | // 获取云端储存的用户偏好
8 | rpc GetUserPreference (GetUserPreferenceReq) returns (GetUserPreferenceReply);
9 | // 设定用户偏好
10 | rpc SetUserPreference (SetUserPreferenceReq) returns (SetUserPreferenceReply);
11 | // 获取云控配置
12 | rpc UserPreference (UserPreferenceReq) returns (UserPreferenceReply);
13 | }
14 |
15 | //
16 | message GetUserPreferenceReq {
17 | //
18 | repeated string type_url = 1;
19 | //
20 | map extra_context = 2;
21 | }
22 |
23 | //
24 | message GetUserPreferenceReply {
25 | // 对应 GetUserPreferenceReq 的请求的类型
26 | repeated google.protobuf.Any value = 1;
27 | }
28 |
29 | //
30 | message SetUserPreferenceReq {
31 | //
32 | repeated google.protobuf.Any preference = 1;
33 | //
34 | map extra_context = 2;
35 | }
36 |
37 | //
38 | message SetUserPreferenceReply {}
39 |
40 | //
41 | message UserPreferenceReq {}
42 |
43 | // 云控配置下发
44 | message UserPreferenceReply {
45 | // 具体解码需要根据实际请求 type_url 来判断
46 | repeated google.protobuf.Any preference = 1;
47 | }
48 |
49 | //
50 | message BoolValue {
51 | //
52 | bool value = 1;
53 | //
54 | int64 last_modified = 2;
55 | //
56 | bool default_value = 3;
57 | //
58 | string exp = 4;
59 | }
60 |
61 | //
62 | message BytesValue {
63 | //
64 | bytes value = 1;
65 | //
66 | int64 last_modified = 2;
67 | //
68 | bytes default_value = 3;
69 | //
70 | string exp = 4;
71 | }
72 |
73 | //
74 | message DoubleValue {
75 | //
76 | double value = 1;
77 | //
78 | int64 last_modified = 2;
79 | //
80 | double default_value = 3;
81 | //
82 | string exp = 4;
83 | }
84 |
85 | //
86 | message FloatValue {
87 | //
88 | float value = 1;
89 | //
90 | int64 last_modified = 2;
91 | //
92 | float default_value = 3;
93 | //
94 | string exp = 4;
95 | }
96 |
97 | //
98 | message Int32Value {
99 | //
100 | int32 value = 1;
101 | //
102 | int64 last_modified = 2;
103 | //
104 | int32 default_value = 3;
105 | //
106 | string exp = 4;
107 | }
108 |
109 | //
110 | message Int64Value {
111 | //
112 | int64 value = 1;
113 | //
114 | int64 last_modified = 2;
115 | //
116 | int64 default_value = 3;
117 | //
118 | string exp = 4;
119 | }
120 |
121 | //
122 | message StringValue {
123 | //
124 | string value = 1;
125 | //
126 | int64 last_modified = 2;
127 | //
128 | string default_value = 3;
129 | //
130 | string exp = 4;
131 | }
132 |
133 | //
134 | message UInt32Value {
135 | //
136 | uint32 value = 1;
137 | //
138 | int64 last_modified = 2;
139 | //
140 | uint32 default_value = 3;
141 | //
142 | string exp = 4;
143 | }
144 |
145 | //
146 | message UInt64Value {
147 | //
148 | uint64 value = 1;
149 | //
150 | int64 last_modified = 2;
151 | //
152 | uint64 default_value = 3;
153 | //
154 | string exp = 4;
155 | }
156 |
157 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/gaia/gw/gw_api.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.gaia.gw;
4 |
5 | import "google/protobuf/empty.proto";
6 |
7 | // 应用列表上报
8 | service Gaia {
9 | // 应用列表上报
10 | rpc ExUploadAppList(GaiaEncryptMsgReq) returns (UploadAppListReply);
11 | // 拉取rsa公钥
12 | rpc ExFetchPublicKey(google.protobuf.Empty) returns (FetchPublicKeyReply);
13 | }
14 |
15 | // 待加密的pb对象
16 | message DeviceAppList {
17 | // 上报类型
18 | // first_installation:首次安装上报 first_open:每日启动上报
19 | string source = 1;
20 | // 安装的系统程序列表
21 | repeated string system_app_list = 2;
22 | //安装的用户程序列表
23 | repeated string user_app_list = 3;
24 | }
25 |
26 | // 加密方式
27 | enum EncryptType {
28 | INVALID_ENCRYPT_TYPE = 0; // 非法值
29 | CLIENT_AES = 1; // 同客户端人工约定AES加密私钥,存储在客户端
30 | SERVER_RSA_AES = 2; // 客户端随机生成一个用于AES加密的私钥,并用服务端下发的RSA公钥来加密
31 | }
32 |
33 | //
34 | message FetchPublicKeyReply {
35 | // 版本号
36 | string version = 1;
37 | // RSA公钥
38 | string public_key = 2;
39 | // 公钥过期时间
40 | int64 deadline = 3;
41 | }
42 |
43 | //
44 | message GaiaDeviceBasicInfo {
45 | //平台&应用信息
46 | string platform = 1; //android/ios/web/h5;
47 | string device = 2; //运行设备, 用于区分不同的app, 见客户端传入的对应参数。对于苹果系统,device有效值为phone, pad;安卓无法区分phone和pad,留空即可。
48 | string mobi_app = 3; //包类型,用于区分不同的app, 见客户端传入的对应参数(mobi_app );对于web端请求,请传空
49 | string origin =4; //客户端appkey, 用以区分不同的客户端,对应客户端请求参数中的appkey,如果无法获取可传空“”
50 | string app_id = 5; //app产品编号 //产品编号,由数据平台分配,粉=1,白=2,蓝=3,直播姬=4,HD=5,海外=6,OTT=7,漫画=8,TV野版=9,小视频=10,网易漫画=11,网易漫画lite=12,网易漫画HD=13,国际版=14
51 |
52 | //应用的版本信息
53 | string sdkver = 6; // SDK版本号 "sdkver": "2.6.6"
54 | string app_version = 7; // app版本 "app_version":"5.36.0"
55 | string app_version_code = 8; // app版本号 "app_version_code":"5360000"
56 | string build = 9; // app版本号,见客户端传入的对应参数;对于web端请求,请传空
57 |
58 | //渠道信息
59 | string channel = 10; //渠道标识,见客户端传入的对应参数;对于web端请求,请传空;对应chid
60 |
61 | //机器硬件信息
62 | string brand =11; //手机品牌,见客户端传入的对应参数;
63 | string model=12; //手机型号,见客户端传入的对应参数
64 | string osver =13; //系统版本,见客户端传入的对应参数
65 | string user_agent=14;
66 |
67 | //设备标识信息
68 | string buvid_local = 15; //本地设备唯一标识
69 | string buvid = 16; //设备唯一标识
70 |
71 | //登陆用户信息
72 | string mid = 17; //最后一次登陆用户的mid,如果无登陆信息,传0即可
73 |
74 | //本次启动信息
75 | int64 fts = 18; // app首次启动时间 "fts":1530447775661
76 | int32 first = 19; // 是否首次启动 是:0 否:1
77 |
78 | //网络相关的信息
79 | string network = 20; // 网络连接方式, WIFI/CELLULAR/OFFLINE/OTHERNET/ETHERNET "network":"WIFI", ESS_NETWORK_STATE、ACCESS_WIFI_STATE
80 | }
81 |
82 | // 应用列表上报-请求
83 | message GaiaEncryptMsgReq {
84 | // 上报头部
85 | GaiaMsgHeader header = 1;
86 | // 加密数据
87 | bytes encrypt_payload = 2;
88 | }
89 |
90 | // 风控通用消息头
91 | message GaiaMsgHeader {
92 | //加密类型
93 | EncryptType encode_type = 1;
94 | //类型
95 | PayloadType payload_type = 2;
96 | //RAS加密后的aes_key
97 | bytes encoded_aes_key = 3;
98 | //当前时间戳(ms)
99 | int64 ts = 4;
100 | }
101 |
102 | // 负载类型
103 | enum PayloadType {
104 | INVALID_PAYLOAD = 0; //非法值
105 | DEVICE_APP_LIST = 1; //设备app列表,对应DeviceAppList
106 | }
107 |
108 | // 应用列表上报-响应
109 | message UploadAppListReply {
110 | // 上报响应id
111 | string trace_id = 1;
112 | }
113 |
--------------------------------------------------------------------------------
/grpc_api/bilibili/cheese/gateway/player/v1/playurl.proto:
--------------------------------------------------------------------------------
1 | syntax = "proto3";
2 |
3 | package bilibili.cheese.gateway.player.v1;
4 |
5 | import "bilibili/app/playurl/v1/playurl.proto";
6 |
7 | // 课程视频url
8 | service PlayURL {
9 | // 播放页信息
10 | rpc PlayView (PlayViewReq) returns (PlayViewReply);
11 | // 投屏地址
12 | rpc Project (ProjectReq) returns (ProjectReply);
13 | }
14 |
15 | // 播放页信息-请求
16 | message PlayViewReq {
17 | // 课程epid(与番剧不互通)
18 | int64 ep_id = 1;
19 | // 视频cid
20 | int64 cid = 2;
21 | // 清晰度
22 | int64 qn = 3;
23 | // 视频流版本
24 | int32 fnver = 4;
25 | // 视频流格式
26 | int32 fnval = 5;
27 | // 下载模式
28 | // 0:播放 1:flv下载 2:dash下载
29 | uint32 download = 6;
30 | // 流url强制是用域名
31 | // 0:允许使用ip 1:使用http 2:使用https
32 | int32 force_host = 7;
33 | // 是否4K
34 | bool fourk = 8;
35 | // 当前页spm
36 | string spmid = 9;
37 | // 上一页spm
38 | string from_spmid = 10;
39 | // 青少年模式
40 | int32 teenagers_mode = 11;
41 | // 视频编码
42 | bilibili.app.playurl.v1.CodeType prefer_codec_type = 12;
43 | // 是否强制请求预览视频
44 | bool is_preview = 13;
45 | }
46 |
47 | // 投屏地址-请求
48 | message ProjectReq {
49 | // 课程epid(与番剧不互通)
50 | int64 ep_id = 1;
51 | // 视频cid
52 | int64 cid = 2;
53 | // 清晰度
54 | int64 qn = 3;
55 | // 视频流版本
56 | int32 fnver = 4;
57 | // 视频流格式
58 | int32 fnval = 5;
59 | // 下载模式
60 | // 0:播放 1:flv下载 2:dash下载
61 | uint32 download = 6;
62 | // 流url强制是用域名
63 | // 0:允许使用ip 1:使用http 2:使用https
64 | int32 force_host = 7;
65 | // 是否4K
66 | bool fourk = 8;
67 | // 当前页spm
68 | string spmid = 9;
69 | // 上一页spm
70 | string from_spmid = 10;
71 | // 投屏协议
72 | // 0:默认乐播 1:自建协议 2:云投屏
73 | int32 protocol = 11;
74 | // 投屏设备
75 | // 0:默认其他 1:OTT设备
76 | int32 device_type = 12;
77 | // 是否flv格式
78 | bool flv_proj = 13;
79 | }
80 |
81 | // 播放页信息-响应
82 | message PlayViewReply {
83 | // 视频url信息
84 | bilibili.app.playurl.v1.VideoInfo video_info = 1;
85 | // 禁用功能配置
86 | PlayAbilityConf play_conf = 2;
87 | }
88 |
89 | // 禁用功能配置
90 | message PlayAbilityConf {
91 | bool background_play_disable = 1; // 后台播放
92 | bool flip_disable = 2; // 镜像反转
93 | bool cast_disable = 3; // 支持投屏
94 | bool feedback_disable = 4; // 反馈
95 | bool subtitle_disable = 5; // 字幕
96 | bool playback_rate_disable = 6; // 播放速度
97 | bool time_up_disable = 7; // 定时停止播放
98 | bool playback_mode_disable = 8; // 播放方式
99 | bool scale_mode_disable = 9; // 画面尺寸
100 | bool like_disable = 10; // 顶
101 | bool dislike_disable = 11; // 踩
102 | bool coin_disable = 12; // 投币
103 | bool elec_disable = 13; // 充电
104 | bool share_disable = 14; // 分享
105 | bool screen_shot_disable = 15; // 截图
106 | bool lock_screen_disable = 16; // 锁屏
107 | bool recommend_disable = 17; // 相关推荐
108 | bool playback_speed_disable = 18; // 倍速
109 | bool definition_disable = 19; // 清晰度
110 | bool selections_disable = 20; // 选集
111 | bool next_disable = 21; // 下一集
112 | bool edit_dm_disable = 22; // 编辑弹幕
113 | bool outer_dm_disable = 25; // 外层面板弹幕设置
114 | bool inner_dm_disable = 26; // 三点内弹幕设置
115 | bool small_window_disable = 27; // 画中画
116 | }
117 |
118 | // 投屏地址-响应
119 | message ProjectReply {
120 | bilibili.app.playurl.v1.PlayURLReply project = 1;
121 | }
122 |
--------------------------------------------------------------------------------
/docs/user/register.md:
--------------------------------------------------------------------------------
1 | # 用户注册
2 |
3 | ## 人机验证
4 |
5 | [完成人机验证(参考验证登录)](../login/login_action/readme.md#验证登录)
6 |
7 | 完成后得到`key`, `challenge`, `validate`, `seccode`四个参数
8 |
9 | ## 发送短信验证码
10 |
11 | [发送短信验证码(参考短信登录)](../login/login_action/SMS.md#发送短信验证码(web端))
12 |
13 | **注意不同的是这里type=1而非21**,推测此参数决定短信内容
14 |
15 | ```bash
16 | curl 'https://passport.bilibili.com/web/sms/general/v2/send' \
17 | --data-urlencode 'key=6eeb28e7bbd64b389da2be3a2778c7e3' \
18 | --data-urlencode 'captchaType=6' \
19 | --data-urlencode 'type=1' \
20 | --data-urlencode 'cid=1' \
21 | --data-urlencode 'tel=13888888888' \
22 | --data-urlencode 'challenge=c52148f88a28b6011db52bb213483ee8' \
23 | --data-urlencode 'validate=a98841cd6ea58e1b1f5783fca73cddb6' \
24 | --data-urlencode 'seccode=a98841cd6ea58e1b1f5783fca73cddb6|jordan'
25 | ```
26 |
27 |
28 | 查看示例
29 |
30 | ```json
31 | {
32 | "code": 0,
33 | "message": "验证码短信已下发"
34 | }
35 | ```
36 |
37 |
38 |
39 | ## 提交注册请求
40 |
41 | > https://passport.bilibili.com/web/reg/tel
42 |
43 | *请求方式:POST*
44 |
45 | **正文参数( application/x-www-form-urlencoded ):**
46 |
47 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
48 | | -------- | ---- | ---------------- | ------ | ------------------------------------------------------------ |
49 | | cid | num | 国际冠字码 | 必要 | 可以从 [获取国际冠字码](../login/login_action/SMS.md#获取国际冠字码_web端) 接口中获取 |
50 | | tel | num | 手机号码 | 必要 | |
51 | | code | num | 短信验证码 | 必要 | |
52 | | nickName | str | 昵称 | 必要 | |
53 | | pwd | str | 密码 | 必要 | 密码为明文 |
54 | | plat | num | 0 | 必要 | 平台? |
55 | | gourl | str | 注册成功跳转地址 | 非必要 | 默认为主页`https://www.bilibili.com/` |
56 |
57 | **json回复:**
58 |
59 | 根对象:
60 |
61 | | 字段 | 类型 | 内容 | 备注 |
62 | | ------- | ---- | -------- | ----------------------------------------------- |
63 | | code | num | 返回值 | 0:成功
1005:验证码错误
1007:验证码过期 |
64 | | message | str | 错误信息 | 成功时无此字段 |
65 | | data | obj | 信息本体 | 只在成功时存在 |
66 |
67 | `data`对象:
68 |
69 | | 字段 | 类型 | 内容 | 备注 |
70 | | ------------ | ---- | ---------- | ----------------------------- |
71 | | redirectUrl | str | 跳转链接 | |
72 | | hint | str | "注册成功" | 成功后不提示成功还能提示什么? |
73 | | in_reg_audit | num | (?) | |
74 |
75 | ```bash
76 | curl 'https://passport.bilibili.com/web/reg/tel' \
77 | --data-urlencode 'plat=0' \
78 | --data-urlencode 'cid=1' \
79 | --data-urlencode 'tel=13888888888' \
80 | --data-urlencode 'code=121314' \
81 | --data-urlencode 'nickName=萌系小妹纸わ'
82 | --data-urlencode 'pwd=Password1234' \
83 | --data-urlencode 'gourl=https://www.bilibili.com'
84 | ```
85 |
86 |
87 | 查看示例
88 |
89 | ```json
90 | {
91 | "code": 0,
92 | "data": {
93 | "redirectUrl": "https://www.bilibili.com",
94 | "hint": "注册成功",
95 | "in_reg_audit": 0
96 | }
97 | }
98 | ```
99 |
100 |
--------------------------------------------------------------------------------
/assets/img/musicplus.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/user/contract.md:
--------------------------------------------------------------------------------
1 | # 加入老粉计划
2 |
3 | > https://api.bilibili.com/x/v1/contract/add_contract
4 |
5 | *请求方式:POST*
6 |
7 | 是否需要登录:`是`
8 |
9 | 认证方式:Cookie(SESSDATA)
10 |
11 | **正文参数 (application/x-www-form-urlencoded):**
12 |
13 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
14 | |----------|-----|--------|-----|-----|
15 | | aid | str | `空串` | | |
16 | | up_mid | str | UP主UID | 必要 | |
17 | | source | str | `4` | | |
18 | | scene | str | `105` | | |
19 | | platform | str | `web` | | |
20 | | mobi_app | str | `pc` | | |
21 | | csrf | str | 用户csrf | 必要 | |
22 |
23 | **json回复:**
24 |
25 | 根对象:
26 |
27 | | 字段名 | 类型 | 内容 | 备注 |
28 | |---------|-----|------|-------------------------|
29 | | code | num | 响应码 | 0:成功
158001:`不满足条件` |
30 | | message | str | 0 | |
31 | | ttl | num | 1 | |
32 | | data | obj | 信息本体 | |
33 |
34 | `data`对象
35 |
36 | | 字段名 | 类型 | 内容 | 备注 |
37 | |---------------|------|-----------------------------------|-----|
38 | | allow_message | bool | `true` | |
39 | | input_text | str | `UP主加油!看好你噢` | |
40 | | input_title | str | `感谢你对UP主的特别支持,“老粉”可期!私信留言鼓励下TA吧 ` | |
41 |
42 | **示例:**
43 |
44 | ```shell
45 | curl --location --request POST 'https://api.bilibili.com/x/v1/contract/add_contract' \
46 | --header 'Cookie: SESSDATA=xxx' \
47 | --header 'Content-Type: application/x-www-form-urlencoded' \
48 | --data-urlencode 'up_mid=2' \
49 | --data-urlencode 'csrf=xxx'
50 | ```
51 |
52 |
53 | 点击查看
54 |
55 | ```json
56 | {
57 | "code": 0,
58 | "message": "0",
59 | "ttl": 1,
60 | "data": {
61 | "allow_message": true,
62 | "input_text": "UP主加油!看好你噢",
63 | "input_title": "感谢你对UP主的特别支持,“老粉”可期!私信留言鼓励下TA吧 "
64 | }
65 | }
66 | ```
67 |
68 |
69 |
70 | # 老粉计划发送留言
71 |
72 | > https://api.bilibili.com/x/v1/contract/add_message
73 |
74 | *请求方式:POST*
75 |
76 | 认证方式:Cookie (SESSDATA)
77 |
78 | **正文参数 (application/x-www-form-urlencoded):**
79 |
80 | | 参数名 | 类型 | 内容 | 必要性 | 备注 |
81 | |---------|-----|--------|-----|-----|
82 | | aid | str | `空串` | | |
83 | | up_mid | str | UP主UID | 必要 | |
84 | | source | str | `4` | | |
85 | | scene | str | `105` | | |
86 | | content | str | 留言内容 | 必要 | |
87 | | csrf | str | 用户csrf | 必要 | |
88 |
89 | **json回复:**
90 |
91 | 根对象:
92 |
93 | | 字段名 | 类型 | 内容 | 备注 |
94 | |---------|-----|------|------------------------------|
95 | | code | num | 响应码 | 0:成功
158005:您跟up主还不是契约关系 |
96 | | message | str | 0 | |
97 | | ttl | num | 1 | |
98 | | data | obj | 信息本体 | |
99 |
100 | `data`对象
101 |
102 | | 字段名 | 类型 | 内容 | 备注 |
103 | |---------------|-----|------------------|-----|
104 | | success_toast | str | `提交成功,UP主已收到留言~` | |
105 |
106 | **示例:**
107 |
108 | ```shell
109 | curl --location --request POST 'https://api.bilibili.com/x/v1/contract/add_message' \
110 | --header 'Cookie: SESSDATA=xxx' \
111 | --header 'Content-Type: application/x-www-form-urlencoded' \
112 | --data-urlencode 'up_mid=2' \
113 | --data-urlencode 'content=..' \
114 | --data-urlencode 'csrf=xxx'
115 | ```
116 |
117 |
118 | 点击查看
119 |
120 | ```json
121 | {
122 | "code": 0,
123 | "message": "0",
124 | "ttl": 1,
125 | "data": {
126 | "success_toast": "提交成功,UP主已收到留言~"
127 | }
128 | }
129 | ```
130 |
131 |
--------------------------------------------------------------------------------