更新大量【proto定义】并勘误

This commit is contained in:
社会易姐QwQ 2021-07-06 21:28:36 +08:00
parent 129b9bc88b
commit ce8d00fcd0
36 changed files with 2951 additions and 2099 deletions

View File

@ -66,12 +66,12 @@ porto定义见[bilibili.community.service.dm.v1.DmSegMobileReply](../grpc_api
获取视频`av810872(CID=1176840)`炮姐的实时弹幕分包1
**注proto定义需要编译**
**注:[proto定义](../grpc_api/bilibili/community/service/dm/v1/dm.proto)需要编译`bilibili.community.service.dm.v1.dm_pb2`并非通过pypi安装**
```python
import requests
import google.protobuf.text_format as text_format
import bilibili.community.service.dm.v1_pb2 as Danmaku
import bilibili.community.service.dm.v1.dm_pb2 as Danmaku
url = 'http://api.bilibili.com/x/v2/dm/web/seg.so'
params = {

View File

@ -1,594 +0,0 @@
syntax = "proto3";
package bilibili.app.interfaces.v1;
import "bilibili/app/playurl/v1.proto";
//
service History {
//
//https://app.bilibili.com/bilibili.app.interface.v1.History/Search
rpc search (SearchReq) returns (SearchReply);
//?
//https://app.bilibili.com/bilibili.app.interface.v1.History/LatestHistory
rpc latestHistory (LatestHistoryReq) returns (LatestHistoryReply);
//
//https://app.bilibili.com/bilibili.app.interface.v1.History/HistoryTab
rpc historyTab (HistoryTabReq) returns (HistoryTabReply);
//
//https://app.bilibili.com/bilibili.app.interface.v1.History/Delete
rpc delete (DeleteReq) returns (NoReply);
//v2接口
//https://app.bilibili.com/bilibili.app.interface.v1.History/CursorV2
rpc cursorV2 (CursorV2Req) returns (CursorV2Reply);
//v1接口
//https://app.bilibili.com/bilibili.app.interface.v1.History/Cursor
rpc cursor (CursorReq) returns (CursorReply);
//
//https://app.bilibili.com/bilibili.app.interface.v1.History/Clear
rpc clear (ClearReq) returns (NoReply);
}
//
service Search {
//
//https://app.bilibili.com/bilibili.app.interface.v1.Search/Suggest3
rpc suggest3 (SuggestionResult3Req) returns (SuggestionResult3Reply);
}
//-
message SearchReq {
//
string keyword = 1;
//
int64 pn = 2;
//
string business = 3;
}
//-
message SearchReply {
//
repeated CursorItem items = 1;
//
bool hasMore = 2;
//
Page page = 3;
}
//?-
message LatestHistoryReq {
//
string business = 1;
//
PlayerPreloadParams playerPreload = 2;
}
//?-
message LatestHistoryReply {
//
CursorItem items = 1;
//
string scene = 2;
}
//-
message HistoryTabReq {
//
string business = 1;
//
HistorySource source = 2;
//
string keyword = 3;
}
//-
message HistoryTabReply {
//
repeated CursorTab tab = 1;
}
//-
message DeleteReq {
//
HisInfo hisInfo = 1;
}
//v2接口-
message CursorV2Req {
//
Cursor cursor = 1;
//
string business = 2;
//
PlayerPreloadParams playerPreload = 3;
//
bilibili.app.playurl.v1.PlayerArgs playerArgs = 4;
}
//v2接口-
message CursorV2Reply {
//
repeated CursorItem items = 1;
//
Cursor cursor = 2;
//
bool hasMore = 3;
}
//v1接口-
message CursorReq {
//
Cursor cursor = 1;
//
string business = 2;
//
PlayerPreloadParams playerPreload = 3;
}
//v1接口-
message CursorReply {
//
repeated CursorItem items = 1;
//
repeated CursorTab tab = 2;
//
Cursor cursor = 3;
//
bool hasMore = 4;
}
//-
message ClearReq {
//
string business = 1;
}
//
message NoReply {
}
//-
message SuggestionResult3Req {
//
string keyword = 1;
//
int32 highlight = 2;
//
int32 teenagersMode = 3;
}
//-
message SuggestionResult3Reply {
//id
string trackid = 1;
//
repeated ResultItem list = 2;
//
string expStr = 3;
}
//
message CardArticle {
//uel
repeated string covers = 1;
//
string name = 2;
//UID
int64 mid = 3;
//
bool displayAttention = 4;
//
string badge = 5;
//
Relation relation = 6;
}
//
message CardCheese {
//url
string cover = 1;
//
int64 progress = 2;
//
int64 duration = 3;
//
string subtitle = 4;
}
//
message CardLive {
//url
string cover = 1;
//
string name = 2;
//UID
int64 mid = 3;
//
string tag = 4;
//
int32 ststus = 5;
//
bool displayAttention = 6;
//
Relation relation = 7;
}
//pgc稿件条目类型
message CardOGV {
//url
string cover = 1;
//
int64 progress = 2;
//
int64 duration = 3;
//
string subtitle = 4;
}
//ugc稿件条目类型
message CardUGC {
//url
string cover = 1;
//
int64 progress = 2;
//
int64 duration = 3;
//UP主昵称
string name = 4;
//UP主UID
int64 mid = 5;
//
bool displayAttention = 6;
//cid
int64 cid = 7;
//P
int32 page = 8;
//
string subtitle = 9;
//
Relation relation = 10;
//稿bvid
string bvid = 11;
//P数
int64 videos = 12;
//
string shortLink = 13;
//
string shareSubtitle = 14;
//
int64 view = 15;
}
//
message Cursor {
//
int64 max = 1;
//
int32 maxTp = 2;
}
//
message CursorItem {
//
oneof cardItemCase {
//ugc稿件
CardUGC cardUGC = 1;
//pgc稿件
CardOGV cardOGV = 2;
//
CardArticle cardArticle = 3;
//
CardLive cardLive = 4;
//
CardCheese cardCheese = 5;
}
//
string title = 6;
//uri/url
string uri = 7;
//
int64 viewAt = 8;
//id
int64 kid = 9;
//id
int64 oid = 10;
//
string business = 11;
//
int32 tp = 12;
//
DeviceType dt = 13;
//
bool hasShare = 14;
}
//
message CursorTab {
//
string business = 1;
//
string name = 2;
//uri
string router = 3;
//
bool focus = 4;
}
//
enum DT {
//
Unknown_VALUE = 0;
//
Phone_VALUE = 1;
//ipad端
Pad_VALUE = 2;
//web端
PC_VALUE = 3;
}
//
message DeviceType {
//
DT type = 1;
//url
string icon = 2;
}
//
message HisInfo {
//
string business = 1;
//id
int64 kid = 2;
}
//
enum HistorySource {
//
history_VALUE = 0;
//
shopping_VALUE = 1;
}
//
message OfficialVerify {
//
int32 type = 1;
//
string desc = 2;
}
//
message Page {
//
int64 pn = 1;
//
int64 total = 2;
}
//
message PlayerPreloadParams {
//
int64 qn = 1;
//
int64 fnver = 2;
//
int64 fnval = 3;
//
int64 forceHost = 4;
//4K
int64 fourk = 5;
}
//
message ReasonStyle {
//
string text = 1;
//
string textColor = 2;
//
string textColorNight = 3;
//
string bgColor = 4;
//
string bgColorNight = 5;
//
string borderColor = 6;
//
string borderColorNight = 7;
//
int32 bgStyle = 8;
}
//
message Relation {
//
int32 status = 1;
//
int32 isFollow = 2;
//
int32 isFollowed = 3;
}
//
message ResultItem {
//
string from = 1;
//()
string title = 2;
//
string keyword = 3;
//
int32 position = 4;
//
string cover = 5;
//
double coverSize = 6;
//
string sugType = 7;
//
int32 termType = 8;
//
string goto = 9;
//
string uri = 10;
//
OfficialVerify officialVerify = 11;
//
string param = 12;
//
int64 mid = 13;
//
int32 fans = 14;
//
int32 level = 15;
//
int32 archives = 16;
//
int64 ptime = 17;
//
string seasonTypeName = 18;
//
string area = 19;
//
string style = 20;
//
string label = 21;
//
double rating = 22;
//
int32 vote = 23;
//
repeated ReasonStyle badges = 24;
//
string styles = 25;
//
int64 moduleId = 26;
//
string liveLink = 27;
}

View File

@ -0,0 +1,374 @@
syntax = "proto3";
package bilibili.app.interfaces.v1;
import "bilibili/app/archive/middleware/v1/preload.proto";
//
service History {
// tab
rpc HistoryTab (HistoryTabReq) returns (HistoryTabReply);
// ()
rpc Cursor (CursorReq) returns (CursorReply);
//
rpc CursorV2 (CursorV2Req) returns (CursorV2Reply);
//
rpc Delete (DeleteReq) returns (NoReply);
//
rpc Search (SearchReq) returns (SearchReply);
//
rpc Clear (ClearReq) returns (NoReply);
//
rpc LatestHistory (LatestHistoryReq) returns (LatestHistoryReply);
}
// tab-
message HistoryTabReq {
//
// archive: live: article: goods: show:
string business = 1;
//
HistorySource source = 2;
//
string keyword = 3;
}
// tab-
message HistoryTabReply {
// tab列表
repeated CursorTab tab = 1;
}
//
enum HistorySource {
//
history_VALUE = 0;
//
shopping_VALUE = 1;
}
// ()-
message CursorReq {
//
Cursor cursor = 1;
//
// all: archive: live: article:
string business = 2;
// ()
PlayerPreloadParams playerPreload = 3;
//
bilibili.app.archive.middleware.v1.PlayerArgs player_args = 4;
}
// ()-
message CursorReply {
//
repeated CursorItem items = 1;
// tab
repeated CursorTab tab = 2;
//
Cursor cursor = 3;
//
bool hasMore = 4;
}
// -
message CursorV2Req {
//
Cursor cursor = 1;
//
// archive: live: article: goods: show:
string business = 2;
// ()
PlayerPreloadParams playerPreload = 3;
//
bilibili.app.archive.middleware.v1.PlayerArgs player_args = 4;
//
bool is_local = 5;
}
// -
message CursorV2Reply {
//
repeated CursorItem items = 1;
//
Cursor cursor = 2;
//
bool hasMore = 3;
}
//
message CursorItem {
//
oneof card_item {
// ugc稿件
CardUGC cardUGC = 1;
// pgc稿件
CardOGV cardOGV = 2;
//
CardArticle cardArticle = 3;
//
CardLive cardLive = 4;
//
CardCheese cardCheese = 5;
}
//
string title = 6;
// uri/url
string uri = 7;
//
int64 viewAt = 8;
// id
int64 kid = 9;
// id
int64 oid = 10;
//
// archive: live: article: goods: show:
string business = 11;
//
int32 tp = 12;
//
DeviceType dt = 13;
//
bool hasShare = 14;
}
// ugc稿件卡片
message CardUGC {
// url
string cover = 1;
//
int64 progress = 2;
//
int64 duration = 3;
// UP主昵称
string name = 4;
// UP主mid
int64 mid = 5;
//
bool displayAttention = 6;
// cid
int64 cid = 7;
// P
int32 page = 8;
// P的标题
string subtitle = 9;
//
Relation relation = 10;
// 稿bvid
string bvid = 11;
// P数
int64 videos = 12;
//
string shortLink = 13;
//
string shareSubtitle = 14;
//
int64 view = 15;
}
// pgc稿件卡片
message CardOGV {
// url
string cover = 1;
//
int64 progress = 2;
//
int64 duration = 3;
//
string subtitle = 4;
}
//
message CardArticle {
// url
repeated string covers = 1;
// UP主昵称
string name = 2;
// UP主mid
int64 mid = 3;
//
bool displayAttention = 4;
//
string badge = 5;
//
Relation relation = 6;
}
//
message CardLive {
// url
string cover = 1;
//
string name = 2;
// mid
int64 mid = 3;
//
string tag = 4;
//
int32 ststus = 5;
//
bool displayAttention = 6;
//
Relation relation = 7;
}
//
message CardCheese {
// url
string cover = 1;
//
int64 progress = 2;
//
int64 duration = 3;
//
string subtitle = 4;
}
//
message CursorTab {
//
string business = 1;
//
string name = 2;
// uri
string router = 3;
// tab定位
bool focus = 4;
}
//
message Cursor {
//
int64 max = 1;
//
int32 maxTp = 2;
}
// -
message DeleteReq {
//
HisInfo hisInfo = 1;
}
//
message HisInfo {
//
// archive: live: article: goods: show:
string business = 1;
// id
int64 kid = 2;
}
//
message NoReply {}
//
message DeviceType {
//
DT type = 1;
// url
string icon = 2;
}
//
enum DT {
//
Un known = 0;
//
Phone = 1;
// ipad端
Pad = 2;
// web端
PC = 3;
// TV端
TV = 4;
//
Car = 5;
//
Iot = 6;
// apad端
AndPad = 7;
}
//
message Relation {
//
// 1: 2: 3: 4:
int32 status = 1;
// UP主
int32 isFollow = 2;
// UP主关注用户
int32 isFollowed = 3;
}
// -
message SearchReq {
//
string keyword = 1;
//
int64 pn = 2;
//
// archive: live: article: goods: show:
string business = 3;
}
// -
message SearchReply {
//
repeated CursorItem items = 1;
//
bool hasMore = 2;
//
Page page = 3;
}
//
message Page {
//
int64 pn = 1;
//
int64 total = 2;
}
//
message PlayerPreloadParams {
//
int64 qn = 1;
//
int64 fnver = 2;
//
int64 fnval = 3;
//
int64 forceHost = 4;
// 4K
int64 fourk = 5;
}
// -
message ClearReq {
//
// archive: live: article: goods: show:
string business = 1;
}
// -
message LatestHistoryReq {
//
// archive: live: article: goods: show:
string business = 1;
//
PlayerPreloadParams playerPreload = 2;
}
// -
message LatestHistoryReply {
//
CursorItem items = 1;
//
string scene = 2;
//
int64 rtime = 3;
// ()
string flag = 4;
}

View File

@ -0,0 +1,119 @@
syntax = "proto3";
package bilibili.app.interfaces.v1;
//
service Search {
//
rpc Suggest3 (SuggestionResult3Req) returns (SuggestionResult3Reply);
}
// -
message SuggestionResult3Req {
//
string keyword = 1;
//
// 0: 1:
int32 highlight = 2;
//
// 1:
int32 teenagersMode = 3;
}
// -
message SuggestionResult3Reply {
// id
string trackid = 1;
//
repeated ResultItem list = 2;
// abtest
string expStr = 3;
}
//
message ResultItem {
//
string from = 1;
// ()
string title = 2;
//
string keyword = 3;
//
int32 position = 4;
//
string cover = 5;
//
double coverSize = 6;
// sug词类型
string sugType = 7;
//
int32 termType = 8;
//
string goto = 9;
// uri
string uri = 10;
//
OfficialVerify officialVerify = 11;
//
string param = 12;
// up主mid
int64 mid = 13;
//
int32 fans = 14;
// up主等级
int32 level = 15;
// up主稿件数
int32 archives = 16;
// 稿
int64 ptime = 17;
// season类型名称
string seasonTypeName = 18;
//
string area = 19;
//
string style = 20;
//
string label = 21;
//
double rating = 22;
//
int32 vote = 23;
//
repeated ReasonStyle badges = 24;
//
string styles = 25;
//
int64 moduleId = 26;
//
string liveLink = 27;
}
//
message OfficialVerify {
//
// 127: 0: 1:
int32 type = 1;
//
string desc = 2;
}
//
message ReasonStyle {
//
string text = 1;
//
string textColor = 2;
//
string textColorNight = 3;
//
string bgColor = 4;
//
string bgColorNight = 5;
//
string borderColor = 6;
//
string borderColorNight = 7;
//
// 1: 2:
int32 bgStyle = 8;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,61 @@
syntax = "proto3";
package bilibili.app.resource.privacy.v1;
//
service Privacy {
//
rpc PrivacyConfig(NoArgRequest) returns(PrivacyConfigReply);
//
rpc SetPrivacyConfig(SetPrivacyConfigRequest) returns(NoReply);
}
//
message NoArgRequest{}
//
message NoReply{}
// -
message PrivacyConfigReply {
//
PrivacyConfigItem privacy_config_item = 1;
}
//
message PrivacyConfigItem {
//
PrivacyConfigType privacy_config_type = 1;
//
string title = 2;
//
PrivacyConfigState state = 3;
//
string sub_title = 4;
//
string sub_title_uri = 5;
}
//
enum PrivacyConfigType {
//
none = 0;
//
dynamic_city = 1;
}
//
enum PrivacyConfigState {
//
close = 0;
//
open = 1;
}
// -
message SetPrivacyConfigRequest {
//
PrivacyConfigType privacy_config_type = 1;
//
PrivacyConfigState state = 2;
}

View File

@ -0,0 +1,133 @@
syntax = "proto3";
package bilibili.app.resource.v1;
//
service Module {
//
rpc List(ListReq) returns (ListReply);
}
//
enum EnvType {
//
Unknown = 0;
//
Release = 1;
//
Test = 2;
}
//
enum LevelType {
Undefined = 0;
//
High = 1;
//
Middle = 2;
// 使
Low = 3;
}
//
message ListReq {
//
string pool_name = 1;
//
string module_name = 2;
//
repeated VersionListReq version_list = 3;
//
EnvType env = 4;
//
int32 sys_ver = 5;
//
int32 scale = 6;
//
int32 arch = 7;
}
//
message VersionListReq {
//
string pool_name = 1;
//
repeated VersionReq versions = 2;
}
//
message VersionReq {
//
string module_name = 1;
//
int64 version = 2;
}
//
enum IncrementType {
//
Total = 0;
//
Incremental = 1;
}
//
enum CompressType {
// unzip
Unzip = 0;
//
Original = 1;
}
message ListReply {
//
string env = 1;
//
repeated PoolReply pools = 2;
}
message PoolReply {
//
string name = 1;
//
repeated ModuleReply modules = 2;
}
message ModuleReply {
//
string name = 1;
//
int64 version = 2;
//
string url = 3;
//
string md5 = 4;
//
string total_md5 = 5;
//
IncrementType increment = 6;
//
bool is_wifi = 7;
//
LevelType level = 8;
//
string filename = 9;
//
string file_type = 10;
//
int64 file_size = 11;
//
CompressType compress = 12;
//
int64 publish_time = 13;
// 使
int64 pool_id = 14;
//
int64 module_id = 15;
//
int64 version_id = 16;
//
int64 file_id = 17;
//
bool zip_check = 18;
}

View File

@ -43,7 +43,7 @@ message PopularResultReq {
//
// 0: 1:
int32 flush = 14;
//
//
bilibili.app.archive.middleware.v1.PlayerArgs playerArgs = 15;
}

View File

@ -585,7 +585,7 @@ message UserSeason {
}
//
message SeasonPlayer{
message SeasonPlayer {
//
int64 aid = 1;
//
@ -898,9 +898,9 @@ enum SeasonType {
//
Unknown = 0;
//
Base = 1;
Base = 1;
//
Good = 2;
Good = 2;
}
// UGC视频合集信息
@ -1085,7 +1085,7 @@ message Node {
}
// 稿-
message ViewProgressReq{
message ViewProgressReq {
// 稿avid
int64 aid = 1;
// cid
@ -1095,7 +1095,7 @@ message ViewProgressReq{
}
// 稿-
message ViewProgressReply{
message ViewProgressReply {
//
VideoGuide videoGuide = 1;
// Chronos灰度管理
@ -1171,7 +1171,7 @@ message OperationCardNew {
oneof renderCase {
//
StandardCard standardCard= 6;
// B剪跳转卡
// (B剪跳转卡)
OperationCard operationCard = 7;
}
//
@ -1200,7 +1200,7 @@ enum OperationCardType {
}
//
message StandardCard{
message StandardCard {
//
string title = 1;
//
@ -1212,7 +1212,7 @@ message StandardCard{
}
//
message OperationCard{
message OperationCard {
// ()
int32 startTime = 1;
// ()
@ -1230,7 +1230,7 @@ message OperationCard{
}
//
message CommandDm{
message CommandDm {
// id
int64 id = 1;
// cid
@ -1306,7 +1306,7 @@ message subTFPanel {
}
// -
message ShortFormVideoDownloadReq{
message ShortFormVideoDownloadReq {
// 稿avid
int64 aid = 1;
// cid
@ -1379,7 +1379,7 @@ message BizFollowVideoParam {
}
//
message BizReserveActivityParam{
message BizReserveActivityParam {
// id
int64 activityId = 1;
//

View File

@ -0,0 +1,30 @@
syntax = "proto3";
package bilibili.broadcast.message.editor;
import "google/protobuf/empty.proto";
//
service OperationNotify {
//
rpc OperationNotify(google.protobuf.Empty) returns (stream Notify);
}
message Notify {
//
int64 msg_id = 1;
//
int32 msg_type = 2;
// uid
int64 receiver_uid = 3;
//
int32 receiver_type = 4;
//
int64 story_version = 5;
// hash值
int64 op_hash = 6;
// uid
int64 op_sender = 7;
// patch内容
string op_content = 8;
}

View File

@ -0,0 +1,8 @@
syntax = "proto3";
package bilibili.broadcast.message.esports;
message Notify {
// cid
int64 cid = 1;
}

View File

@ -0,0 +1,18 @@
syntax = "proto3";
package bilibili.broadcast.message.fission;
import "google/protobuf/empty.proto";
//
service Fission {
//
rpc GameNotify(google.protobuf.Empty) returns (stream GameNotifyReply);
}
message GameNotifyReply {
//
uint32 type = 1;
//
string data = 2;
}

View File

@ -0,0 +1,99 @@
syntax = "proto3";
package bilibili.broadcast.message.im;
import "google/protobuf/empty.proto";
//
service Notify {
//
rpc WatchNotify(google.protobuf.Empty) returns (stream NotifyRsp);
}
//
enum PLType {
//
EN_PAYLOAD_NORMAL = 0;
//
EN_PAYLOAD_BASE64 = 1;
}
//
enum CmdId {
// cmd
EN_CMD_ID_INVALID = 0;
//
EN_CMD_ID_MSG_NOTIFY = 1;
//
EN_CMD_ID_KICK_OUT = 2;
}
//
message NotifyRsp {
//
uint64 uid=1;
// id
uint64 cmd=2;
//
bytes payload=3;
//
PLType payload_type=4;
}
//
message Msg {
// uid
uint64 sender_uid = 1;
//
int32 receiver_type = 2;
// id
uint64 receiver_id = 3;
// id
uint64 cli_msg_id = 4;
//
int32 msg_type = 5;
//
string content = 6;
//
uint64 msg_seqno = 7;
//
uint64 timestamp = 8;
// at用户列表
repeated uint64 at_uids = 9;
//
repeated uint64 recver_ids = 10;
//
uint64 msg_key = 11;
//
uint32 msg_status = 12;
//
bool sys_cancel = 13;
//
uint32 is_multi_chat = 14;
// session_seqno
uint64 withdraw_seqno = 15;
//
string notify_code =16;
//
uint32 msg_source = 17;
}
//
message NotifyInfo {
//
uint32 msg_type = 1;
//
uint64 talker_id = 2;
//
uint32 session_type =3;
}
//
message ReqServerNotify {
//
uint64 lastest_seqno = 1;
// sync msg时 sync到此类消息
Msg instant_msg = 2;
//
NotifyInfo notify_info = 3;
}

View File

@ -1,189 +0,0 @@
syntax = "proto3";
package bilibili.broadcast.message.main;
import "google/protobuf/empty.proto";
//
service NativePage {
//
//
rpc watchNotify (google.protobuf.Empty) returns (NativePageEvent);
}
//
service Resource {
//
//
rpc topActivity (google.protobuf.Empty) returns (TopActivityReply);
}
//
message NativePageEvent {
//
int64 pageID = 1;
//
repeated EventItem items = 2;
}
//
message TopActivityReply {
//
TopOnline online = 1;
//
string hash = 2;
}
//
message Animate {
//
string icon = 1;
//
string json = 2;
//
string svg = 3;
//
int32 loop = 4;
}
//
message CommandDm {
//
int64 id = 1;
//
int64 oid = 2;
//
int64 mid = 3;
//
int32 type = 4;
//
string command = 5;
//
string content = 6;
//
int32 state = 7;
//
int32 progress = 8;
//
string ctime = 9;
//
string mtime = 10;
//
string extra = 11;
//
string idStr = 12;
}
//
message DanmakuElem {
//
int64 id = 1;
//
int32 progress = 2;
//
int32 mode = 3;
//
int32 fontsize = 4;
//
uint32 color = 5;
//
string midHash = 6;
//
string content = 7;
//
int64 ctime = 8;
//
string action = 9;
//
int32 pool = 10;
//
string idStr = 11;
}
//
message DanmukuEvent {
//
DanmakuElem elems = 1;
}
//
message EventItem {
//
int64 itemID = 1;
//
string type = 2;
//
int64 num = 3;
//
string displayNum = 4;
//
string webKey = 5;
//
int64 dimension = 6;
}
//
message RedDot {
//
int32 type = 1;
//
int32 number = 2;
}
//
message TopOnline {
//
int32 type = 1;
//
string icon = 2;
//
string uri = 3;
//
string uniqueId = 4;
//
Animate animate = 5;
//
RedDot redDot = 6;
//
string name = 7;
//
int64 interval = 8;
}

View File

@ -0,0 +1,63 @@
syntax = "proto3";
package bilibili.broadcast.message.main;
//
message DanmukuEvent {
//
repeated DanmakuElem elems = 1;
}
//
message DanmakuElem {
// dmid
int64 id = 1;
// (ms)
int32 progress = 2;
//
int32 mode = 3;
//
int32 fontsize = 4;
//
uint32 color = 5;
// mid hash
string mid_hash = 6;
//
string content = 7;
//
int64 ctime = 8;
//
string action = 9;
//
int32 pool = 10;
// id str
string id_str = 11;
}
//
message CommandDm {
// id
int64 id = 1;
// cid
int64 oid = 2;
// mid
int64 mid = 3;
//
int32 type = 4;
//
string command = 5;
//
string content = 6;
//
int32 state = 7;
//
int32 progress = 8;
//
string ctime = 9;
//
string mtime = 10;
// json数据
string extra = 11;
// id str类型
string idStr = 12;
}

View File

@ -0,0 +1,36 @@
syntax = "proto3";
package bilibili.broadcast.message.main;
import "google/protobuf/empty.proto";
//
service NativePage {
//
rpc WatchNotify(google.protobuf.Empty) returns (stream NativePageEvent);
}
//
message NativePageEvent {
// Native页ID
int64 PageID = 1;
//
repeated EventItem Items = 2;
}
//
message EventItem {
//
int64 ItemID = 1;
//
string Type = 2;
//
int64 Num = 3;
//
string DisplayNum = 4;
// h5的组件标识
string WebKey = 5;
//
// 0: 1:
int64 dimension = 6;
}

View File

@ -0,0 +1,61 @@
syntax = "proto3";
package bilibili.broadcast.message.main;
import "google/protobuf/empty.proto";
//
service Resource {
//
rpc TopActivity(google.protobuf.Empty) returns (stream TopActivityReply);
}
//
message TopActivityReply {
//
TopOnline online = 1;
// online内容进行hash和上次结果一样则不重新加载
string hash = 2;
}
//
message TopOnline {
//
// 1: 2:
int32 type = 1;
//
string icon = 2;
//
string uri = 3;
// ()
string unique_id = 4;
//
Animate animate = 5;
//
RedDot red_dot = 6;
//
string name = 7;
//
int64 interval = 8;
}
//
message Animate {
// icon
string icon = 1;
// 7
string json = 2;
// s10活动svg动画
string svg = 3;
// (0 )
int32 loop = 4;
}
//
message RedDot {
//
// 1: 2:
int32 type = 1;
//
int32 number = 2;
}

View File

@ -0,0 +1,11 @@
syntax = "proto3";
package bilibili.broadcast.message.note;
//
message Sync {
// id
int64 note_id = 1;
//
string hash = 2;
}

View File

@ -0,0 +1,228 @@
syntax = "proto3";
package bilibili.broadcast.message.ogv;
//
enum PlayStatus {
//
Pause = 0;
//
Play = 1;
//
End = 2;
}
//
enum RoomType {
//
Private = 0;
//
Open = 1;
}
//
enum MessageDomain {
//
DefaultDomain = 0;
//
RoomMid = 1;
//
SystemInfo = 2;
}
//
enum MessageType {
//
DefaultType = 0;
//
ChatMessage = 1;
//
SystemMessage = 2;
}
//
enum TriggerType {
//
DefaultTrigger = 0;
//
Relation = 1;
}
//
message RoomMemberChangeEvent {
// id
int64 room_id = 1;
// id
int64 owner_id = 2;
//
repeated UserInfoProto members = 3;
//
MessageProto message = 4;
}
//
message ProgressSyncEvent {
// id
int64 room_id = 1;
// season_id
int64 season_id = 2;
// episode_id
int64 episode_id = 3;
//
PlayStatus status = 4;
//
int64 progress = 5;
//
MessageProto message = 6;
}
//
message RoomUpdateEvent {
// id
int64 room_id = 1;
//
RoomType type = 2;
//
MessageProto message = 3;
}
//
message RoomDestroyEvent {
// id
int64 room_id = 1;
//
MessageProto message = 4;
}
//
message RoomTriggerEvent {
//
int64 mid = 1;
//
MessageProto message = 2;
//
TriggerType trigger = 3;
}
//
message UserInfoProto {
// id
int64 mid = 1;
// url
string face = 2;
//
string nickname = 3;
//
int32 level = 4;
//
string sign = 5;
//
VipProto vip = 6;
//
OfficialProto official = 7;
//
PendantProto pendant = 8;
// buvid
string buvid = 9;
}
//
message MessageProto {
// ep "还没有其他小伙伴,[去邀请>]<https://big.bilibili.com/mobile/giftIndex?mid=123>"
string content = 1;
//
// 0:json格式的文本消息 1:()
int32 content_type = 2;
}
//
message VipProto {
int32 type = 1;
int32 status = 2;
int64 due_date = 3;
int32 vip_pay_type = 4;
int32 theme_type = 5;
//
// 0: 1: 2:绿
int32 avatar_subscript = 6;
// #FFFB9E60
string nickname_color = 7;
}
//
message OfficialProto {
int32 role = 1;
string title = 2;
string desc = 3;
int32 type = 4;
}
//
message PendantProto {
int32 pid = 1;
string name = 2;
string image = 3;
int64 expire = 4;
string image_enhance = 5;
}
//
message MessageEvent {
// id
int64 room_id = 1;
// id
int64 msg_id = 2;
//
int64 ts = 3;
// id
int64 oid = 4;
//
MessageDomain domain = 5;
//
MessageType type = 6;
//
MessageProto message = 7;
//
UserInfoProto user = 8;
// id str类型
string msg_id2 = 9;
}
//
message RemoveChatEvent {
// id
int64 room_id = 1;
// id
int64 msg_id = 2;
//
MessageProto message = 3;
}
// "一起看"
message FreyaEventBody {
// id
int64 room_id = 1;
//
repeated int64 white_mid = 2;
//
repeated int64 ignore_mid = 3;
//
oneof event {
//
RoomMemberChangeEvent member_change = 4;
//
ProgressSyncEvent progress = 5;
//
RoomUpdateEvent room_update = 6;
//
MessageEvent message = 7;
//
RemoveChatEvent remove_chat = 8;
//
RoomDestroyEvent room_destroy = 9;
//
RoomTriggerEvent room_trigger = 10;
}
//
int64 sequence_id = 100;
}

View File

@ -0,0 +1,44 @@
syntax = "proto3";
package bilibili.broadcast.message.ogv;
//
message LiveStartEvent {}
//
message LiveEndEvent {}
// 线
message LiveOnlineEvent {
//线
int64 online = 1;
}
//
message LiveUpdateEvent {
//
// 1:线 2:
int32 after_premiere_type = 1;
// ms
int64 start_time = 2;
// id
string id = 3;
//
// progress - delay_time
int64 progress = 4;
}
//
message CMDBody {
//
oneof event {
//
LiveStartEvent start = 1;
//
LiveEndEvent emergency = 2;
// 线
LiveOnlineEvent online = 3;
//
LiveUpdateEvent update = 4;
}
}

View File

@ -0,0 +1,21 @@
syntax = "proto3";
package bilibili.broadcast.message.ticket;
//
enum RoomStatus {
// :
Pause = 0;
// :
Play = 1;
// :
End = 2;
}
//
message RoomEvent {
// RoomStatus
RoomStatus room_status = 1;
//
string room_message = 2;
}

View File

@ -0,0 +1,77 @@
syntax = "proto3";
package bilibili.broadcast.message.tv;
import "google/protobuf/empty.proto";
//
service Tv {
//
rpc Proj(google.protobuf.Empty) returns (stream ProjReply);
//
rpc LiveStatus(google.protobuf.Empty) returns (stream LiveStatusNotify);
//
rpc Esports(google.protobuf.Empty) returns (stream EsportsNotify);
//
rpc Publicity(google.protobuf.Empty) returns (stream PublicityNotify);
//
rpc LiveSkip(google.protobuf.Empty) returns (stream LiveSkipNotify);
}
//
message ProjReply {
//
// 1: 2: 3:退 4:seek播放进度 5: 6:
int64 cmd_type = 1;
// id
int64 mid = 2;
// 稿id
int64 aid = 3;
// id
int64 cid = 4;
//
// 0:ugc 1:pgc 2:pugv
int64 video_type = 5;
// idpgc和pugv需要传
int64 ep_id = 6;
// id
int64 season_id = 7;
// seek cmd位seek时有值
int64 seek_ts = 8;
//
string extra = 9;
}
//
message LiveStatusNotify {
//
// 1: 2: 3: 4:
int64 status = 1;
//
string msg = 2;
//
int64 cid = 3;
}
//
message EsportsNotify {
//
int64 cid = 1;
}
//
message PublicityNotify {
// id
int64 publicity_id = 1;
//
int64 room_id = 2;
//
// 0: 1: 2:
int64 status = 3;
}
//
message LiveSkipNotify {
// id
int64 live_id = 1;
}

View File

@ -0,0 +1,96 @@
syntax = "proto3";
package bilibili.broadcast.v1;
import "bilibili/rpc/status.proto";
import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
// broadcast操作target_path
service Broadcast {
//
rpc Auth(AuthReq) returns (AuthResp);
// 44530s545
rpc Heartbeat(HeartbeatReq) returns (HeartbeatResp);
// target_path
rpc Subscribe(TargetPath) returns (google.protobuf.Empty);
// target_path
rpc Unsubscribe(TargetPath) returns (google.protobuf.Empty);
//
rpc MessageAck(MessageAckReq) returns (google.protobuf.Empty);
}
// broadcast连接隧道
service BroadcastTunnel {
// stream连接隧道
rpc CreateTunnel(stream BroadcastFrame) returns (stream BroadcastFrame);
}
// authorization验证绑定用户mid
message AuthReq {
// iduuid
string guid = 1;
// iduuid
string conn_id = 2;
// id
int64 last_msg_id = 3;
}
//
message AuthResp {}
//
message HeartbeatReq{}
//
message HeartbeatResp{}
// target_path
message TargetPath {
// target_paths
repeated string target_paths = 1;
}
//
message MessageAckReq {
// id
int64 ack_id = 1;
// ack来源
string ack_origin = 2;
// target_path便
string target_path = 3;
}
// message_id:
// client: id
// server: id
// sequence:
// client: frame seq++req/resp
// server: 0
message FrameOption {
// id
int64 message_id = 1;
// frame序号
int64 sequence = 2;
// (MessageAckReq)
// downstream true
// upstream true
// is_ack
// is_ack, ()
bool is_ack = 3;
//
bilibili.rpc.Status status = 4;
// ack来源, downstream时候由服务端填写.
string ack_origin = 5;
}
// target_path:
// "/" Service-Name "/" {method name} gRPC Request Path
message BroadcastFrame {
//
FrameOption options = 1;
// target_path
string target_path = 2;
// pb内容
google.protobuf.Any body = 3;
}

View File

@ -0,0 +1,19 @@
syntax = "proto3";
package bilibili.broadcast.v1;
import "google/protobuf/empty.proto";
// Laser
service Laser {
//
rpc WatchLogUploadEvent(google.protobuf.Empty) returns (stream LaserLogUploadResp);
}
//
message LaserLogUploadResp {
// id
int64 taskid = 1;
//
string date = 2;
}

View File

@ -0,0 +1,13 @@
syntax = "proto3";
package bilibili.broadcast.v1;
import "google/protobuf/empty.proto";
message ModResourceResp {}
// ModManager
service ModManager {
//
rpc WatchResource(google.protobuf.Empty) returns (stream ModResourceResp);
}

View File

@ -0,0 +1,126 @@
syntax = "proto3";
package bilibili.broadcast.v1;
import "google/protobuf/empty.proto";
// Push
service Push {
rpc WatchMessage(google.protobuf.Empty) returns (stream PushMessageResp);
}
//
message PushMessageResp {
//
enum Biz {
//
BIZ_UNKNOWN = 0;
//
BIZ_VIDEO = 1;
//
BIZ_LIVE = 2;
//
BIZ_ACTIVITY = 3;
}
//
enum Type {
//
TYPE_UNKNOWN = 0;
//
TYPE_DEFAULT = 1;
//
TYPE_HOT = 2;
//
TYPE_REALTIME = 3;
//
TYPE_RECOMMEND = 4;
}
//
enum Position {
//
POS_UNKNOWN = 0;
//
POS_TOP = 1;
}
// Deprecated: id使string
int64 old_taskid = 1;
//
// 1: 2: 3:
Biz biz = 2;
//
// 1: 2: 3: 4:
Type type = 3;
//
string title = 4;
//
string summary = 5;
//
string img = 6;
//
string link = 7;
// 1
Position position = 8;
// 3
int32 duration = 9;
//
int64 expire = 10;
// id
string taskid = 11;
//
// UGC: ugc-video-detail
// PGC: pgc-video-detail
// : pgc-video-detail-theater
// : live-room-detail
// Story: ugc-video-detail-vertical
// playlist-video-detail
repeated PageBlackList page_blackList = 12;
// pvid
repeated PageView page_view = 13;
//
TargetResource target_resource = 14;
}
//
message PageBlackList {
//
string id = 1;
}
//
message PageView {
//
string id = 1;
}
//
enum LinkType {
//
LINK_TYPE_UNKNOWN = 0;
//
LINK_TYPE_BANGUMI = 1;
//
LINK_TYPE_VIDEO = 2;
//
LINK_TYPE_LIVE = 3;
}
//
message TargetResource {
//: roomid
//UGC: avid
//PGC: seasonid
//Story: avid
//
//Type: LINK_TYPE_BANGUMI ()
//Resource: {"seasonid":"123"}
//
//Type: LINK_TYPE_VIDEO ()
//Resource: {"avid":"123"}
//
//Type: LINK_TYPE_LIVE ()
//Resource: {"roomid":"123"}
//
LinkType Type = 1;
//
map<string,string> Resource = 2;
}

View File

@ -0,0 +1,72 @@
syntax = "proto3";
package bilibili.broadcast.v1;
import "bilibili/rpc/status.proto";
import "google/protobuf/any.proto";
//
service BroadcastRoom {
//
rpc Enter(stream RoomReq) returns (stream RoomResp);
}
//
message RoomJoinEvent {}
//
message RoomLeaveEvent {}
//
message RoomOnlineEvent {
//
int32 online = 1;
}
//
message RoomMessageEvent {
//
string target_path = 1;
//
google.protobuf.Any body = 2;
}
//
message RoomErrorEvent {
//
bilibili.rpc.Status status = 1;
}
//
message RoomReq {
// {type}://{room_id}
string id = 1;
oneof event {
//
RoomJoinEvent join = 2;
//
RoomLeaveEvent leave = 3;
//
RoomOnlineEvent online = 4;
//
RoomMessageEvent msg = 5;
}
}
//
message RoomResp {
// {type}://{room_id}
string id = 1;
oneof event {
//
RoomJoinEvent join = 2;
//
RoomLeaveEvent leave = 3;
//
RoomOnlineEvent online = 4;
//
RoomMessageEvent msg = 5;
//
RoomErrorEvent err = 6;
}
}

View File

@ -0,0 +1,26 @@
syntax = "proto3";
package bilibili.broadcast.v1;
import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
// debug/release包都会通过弹窗响应该消息
//
// Test
service Test {
//
rpc WatchTestEvent(google.protobuf.Empty) returns (stream TestResp);
}
message TestResp {
// id
int64 taskid = 1 [json_name="taskid"];
//
int64 timestamp = 2 [json_name="timestamp"];
//
string message = 3 [json_name="message"];
//
google.protobuf.Any extra = 4;
}

View File

@ -0,0 +1,21 @@
syntax = "proto3";
package bilibili.broadcast.v2;
import "google/protobuf/empty.proto";
// Laser
service Laser {
// Laser事件
rpc WatchEvent(google.protobuf.Empty) returns (stream LaserEventResp);
}
// Laser事件
message LaserEventResp {
// id
int64 taskid = 1;
//
string action = 2;
// json字符串
string params = 3;
}

View File

@ -1,163 +0,0 @@
syntax = "proto3";
package bilibili.cheese.gateway.player.v1;
import "bilibili/app/playurl/v1.proto";
service PlayURL {
//url接口
//https://app.bilibili.com/bilibili.cheese.gateway.player.v1.PlayURL/PlayView
rpc PlayView (playViewReq) returns (PlayViewReply);
}
//url-
message playViewReq {
//epid
int64 epid = 1;
//cid
int64 cid = 2;
//
int64 qn = 3;
//
int32 fnver = 4;
//
int32 fnval = 5;
//
//0: 1:flv下载 2:dash下载
uint32 download = 6;
//url强制是用域名
//0:使ip 1:使http 2:使https
int32 forceHost = 7;
//4K
bool fourk = 8;
//
string spmid = 9;
//
string fromSpmid = 10;
//
int32 teenagersMode = 11;
//
CodeType codetype = 12;
//
bool isPreview = 13;
}
//url-
message PlayViewReply {
//
bilibili.app.playurl.v1.VideoInfo info = 1;
//
PlayAbilityConf PlayConf = 2;
}
//
enum CodeType {
//
NOCODE = 0;
//H.264
CODE264 = 1;
//H.265
CODE265 = 2;
}
//
message PlayAbilityConf {
//
bool backgroundPlayDisable=1;
//
bool flipDisable=2;
//
bool castDisable=3;
//
bool feedbackDisable=4;
//
bool subtitleDisable=5;
//
bool playbackRateDisable=6;
//
bool timeUpDisable=7;
//
bool playbackModeDisable=8;
//
bool scaleModeDisable=9;
//
bool likeDisable=10;
//
bool dislikeDisable=11;
//
bool coinDisable=12;
//
bool elecDisable=13;
//
bool shareDisable=14;
//
bool screenShotDisable=15;
//
bool lockScreenDisable=16;
//
bool recommendDisable=17;
//
bool playbackSpeedDisable=18;
//
bool definitionDisable=19;
//
bool selectionsDisable=20;
//
bool nextDisable=21;
//
bool editDmDisable=22;
//
bool smallWindowDisable=23;
//
bool shakeDisable=24;
//
bool outerDmDisable=25;
//
bool innerDmDisable=26;
//
bool freyaEnterDisable=27;
//
bool dolbyDisable=28;
}

View File

@ -0,0 +1,146 @@
syntax = "proto3";
package bilibili.cheese.gateway.player.v1;
import "bilibili/app/playurl/v1/playurl.proto";
// url
service PlayURL {
//
rpc PlayView (PlayViewReq) returns (PlayViewReply);
//
rpc Project (ProjectReq) returns (ProjectReply);
}
// -
message PlayViewReq {
// epid()
int64 ep_id = 1;
// cid
int64 cid = 2;
//
int64 qn = 3;
//
int32 fnver = 4;
//
int32 fnval = 5;
//
// 0: 1:flv下载 2:dash下载
uint32 download = 6;
// url强制是用域名
// 0:使ip 1:使http 2:使https
int32 force_host = 7;
// 4K
bool fourk = 8;
// spm
string spmid = 9;
// spm
string from_spmid = 10;
//
int32 teenagers_mode = 11;
//
bilibili.app.playurl.v1.CodeType prefer_codec_type = 12;
//
bool is_preview = 13;
}
// -
message ProjectReq {
// epid()
int64 ep_id = 1;
// cid
int64 cid = 2;
//
int64 qn = 3;
//
int32 fnver = 4;
//
int32 fnval = 5;
//
// 0: 1:flv下载 2:dash下载
uint32 download = 6;
// url强制是用域名
// 0:使ip 1:使http 2:使https
int32 force_host = 7;
// 4K
bool fourk = 8;
// spm
string spmid = 9;
// spm
string from_spmid = 10;
//
// 0: 1: 2:
int32 protocol = 11;
//
// 0: 1:OTT设备
int32 device_type = 12;
// flv格式
bool flv_proj = 13;
}
// -
message PlayViewReply {
// url信息
bilibili.app.playurl.v1.VideoInfo video_info = 1;
//
PlayAbilityConf play_conf = 2;
}
//
message PlayAbilityConf {
//
bool background_play_disable = 1;
//
bool flip_disable = 2;
//
bool cast_disable = 3;
//
bool feedback_disable = 4;
//
bool subtitle_disable = 5;
//
bool playback_rate_disable = 6;
//
bool time_up_disable = 7;
//
bool playback_mode_disable = 8;
//
bool scale_mode_disable = 9;
//
bool like_disable = 10;
//
bool dislike_disable = 11;
//
bool coin_disable = 12;
//
bool elec_disable = 13;
//
bool share_disable = 14;
//
bool screen_shot_disable = 15;
//
bool lock_screen_disable = 16;
//
bool recommend_disable = 17;
//
bool playback_speed_disable = 18;
//
bool definition_disable = 19;
//
bool selections_disable = 20;
//
bool next_disable = 21;
//
bool edit_dm_disable = 22;
//
bool outer_dm_disable = 25;
//
bool inner_dm_disable = 26;
//
bool small_window_disable = 27;
}
// -
message ProjectReply {
bilibili.app.playurl.v1.PlayURLReply project = 1;
}

View File

@ -1,546 +0,0 @@
syntax = "proto3";
package bilibili.community.service.dm.v1;
//
service DM {
//
//https://app.bilibili.com/bilibili.community.service.dm.v1.DM/DmPlayerConfig
rpc DmPlayerConfig (DmPlayerConfigReq) returns (Response);
//
//
rpc DmSegMobile (DmSegMobileReq) returns (DmSegMobileReply);
//
//https://app.bilibili.com/bilibili.community.service.dm.v1.DM/DmView
rpc DmView (DmViewReq) returns (DmViewReply);
}
//-
message DmPlayerConfigReq{
//
int64 ts = 1;
//
PlayerDanmakuSwitch switch = 2;
//
PlayerDanmakuSwitchSave switchSave = 3;
//
PlayerDanmakuUseDefaultConfig useDefaultConfig = 4;
//
PlayerDanmakuAiRecommendedSwitch aiRecommendedSwitch = 5;
//
PlayerDanmakuAiRecommendedLevel aiRecommendedLevel = 6;
//
PlayerDanmakuBlocktop blocktop = 7;
//
PlayerDanmakuBlockscroll blockscroll = 8;
//
PlayerDanmakuBlockbottom blockbottom = 9;
//
PlayerDanmakuBlockcolorful blockcolorful = 10;
//
PlayerDanmakuBlockrepeat blockrepeat = 11;
//
PlayerDanmakuBlockspecial blockspecial = 12;
//
PlayerDanmakuOpacity opacity = 13;
//
PlayerDanmakuScalingfactor scalingfactor = 14;
//
PlayerDanmakuDomain domain = 15;
//
PlayerDanmakuSpeed speed = 16;
//
PlayerDanmakuEnableblocklist enableblocklist = 17;
//
InlinePlayerDanmakuSwitch inlinePlayerDanmakuSwitch = 18;
}
//-
message Response{
//
int32 code = 1;
//
string message = 2;
}
//-
message DmSegMobileReq{
//稿avid/epid
int64 pid = 1;
//cid/cid
int64 oid = 2;
//
//1: 2:
int32 type = 3;
//
int64 segmentIndex = 4;
//
int32 teenagersMode = 5;
}
//-
message DmSegMobileReply{
//
repeated DanmakuElem elems = 1;
//
//0: 1:
int32 state = 2;
//
DanmakuAIFlag aiFlag = 3;
}
//-
message DmViewReq{
//稿avid/epid
int64 pid = 1;
//cid/cid
int64 oid = 2;
//
//1: 2:
int32 type = 3;
//spm
string spmid = 4;
//
int32 isHardBoot = 5;
}
//-
message DmViewReply{
//
//0: 1:
bool closed = 1;
//
VideoMask mask = 2;
//
VideoSubtitle subtitle = 3;
//url
repeated string specialDms = 4;
//
DanmakuFlagConfig aiFlag = 5;
//
DanmuPlayerViewConfig playerConfig = 6;
//
int32 sendBoxStyle = 7;
//
bool allow = 8;
//
string checkBox = 9;
//
string checkBoxShowMsg = 10;
//
string textPlaceholder = 11;
//
string inputPlaceholder = 12;
//
repeated string reportFilterContent = 13;
}
//
message DanmakuAIFlag{
//
repeated DanmakuFlag dmFlags = 1;
}
//
message DanmakuElem{
//dmid
int64 id = 1;
//
int32 progress = 2;
//
int32 mode = 3;
//
int32 fontsize = 4;
//
uint32 color = 5;
//UID hash
string midHash = 6;
//
string content = 7;
//
int64 ctime = 8;
//
int32 weight = 9;
//
string action = 10;
//
int32 pool = 11;
//dmid-str
string idStr = 12;
//
//0: 4: 16:?
int32 attr = 13;
}
//
message DanmakuFlag{
//
int64 dmid = 1;
//
uint32 flag = 2;
}
//
message DanmakuFlagConfig{
//
int32 recFlag = 1;
//
string recText = 2;
//
int32 recSwitch = 3;
}
//
message DanmuDefaultPlayerConfig{
//
bool playerDanmakuUseDefaultConfig = 1;
//
bool playerDanmakuAiRecommendedSwitch = 4;
//
int32 playerDanmakuAiRecommendedLevel = 5;
//
bool playerDanmakuBlocktop = 6;
//
bool playerDanmakuBlockscroll = 7;
//
bool playerDanmakuBlockbottom = 8;
//
bool playerDanmakuBlockcolorful = 9;
//
bool playerDanmakuBlockrepeat = 10;
//
bool playerDanmakuBlockspecial = 11;
//
float playerDanmakuOpacity = 12;
//
float playerDanmakuScalingfactor = 13;
//
float playerDanmakuDomain = 14;
//
int32 playerDanmakuSpeed = 15;
//
bool inlinePlayerDanmakuSwitch = 16;
}
//
message DanmuPlayerConfig{
//
bool playerDanmakuSwitch = 1;
//
bool playerDanmakuSwitchSave = 2;
//
bool playerDanmakuUseDefaultConfig = 3;
//
bool playerDanmakuAiRecommendedSwitch = 4;
//
int32 playerDanmakuAiRecommendedLevel = 5;
//
bool playerDanmakuBlocktop = 6;
//
bool playerDanmakuBlockscroll = 7;
//
bool playerDanmakuBlockbottom = 8;
//
bool playerDanmakuBlockcolorful = 9;
//
bool playerDanmakuBlockrepeat = 10;
//
bool playerDanmakuBlockspecial = 11;
//
float playerDanmakuOpacity = 12;
//
float playerDanmakuScalingfactor = 13;
//
float playerDanmakuDomain = 14;
//
int32 playerDanmakuSpeed = 15;
//
bool playerDanmakuEnableblocklist = 16;
//
bool inlinePlayerDanmakuSwitch = 17;
//
int32 inlinePlayerDanmakuConfig = 18;
}
//
message DanmuPlayerDynamicConfig{
//
int32 progress = 1;
//
float playerDanmakuDomain = 2;
}
//
message DanmuPlayerViewConfig{
//
DanmuDefaultPlayerConfig danmukuDefaultPlayerConfig = 1;
//
DanmuPlayerConfig danmukuPlayerConfig = 2;
//
repeated DanmuPlayerDynamicConfig danmukuPlayerDynamicConfig = 3;
}
//
message InlinePlayerDanmakuSwitch{
//
bool value = 1;
}
//
message PlayerDanmakuAiRecommendedLevel{
//
bool value = 1;
}
//
message PlayerDanmakuAiRecommendedSwitch{
//
bool value = 1;
}
//
message PlayerDanmakuBlockbottom{
//
bool value = 1;
}
//
message PlayerDanmakuBlockcolorful{
//
bool value = 1;
}
//
message PlayerDanmakuBlockrepeat{
//
bool value = 1;
}
//
message PlayerDanmakuBlockscroll{
//
bool value = 1;
}
//
message PlayerDanmakuBlockspecial{
//
bool value = 1;
}
//
message PlayerDanmakuBlocktop{
//
bool value = 1;
}
//
message PlayerDanmakuDomain{
//
float value = 1;
}
//
message PlayerDanmakuEnableblocklist{
//
bool value = 1;
}
//
message PlayerDanmakuOpacity{
//
float value = 1;
}
//
message PlayerDanmakuScalingfactor{
//
float value = 1;
}
//
message PlayerDanmakuSpeed{
//
int32 value = 1;
}
//
message PlayerDanmakuSwitch{
//
bool value = 1;
}
//
message PlayerDanmakuSwitchSave{
//
bool value = 1;
}
//
message PlayerDanmakuUseDefaultConfig{
//
bool value = 1;
}
//
message SubtitleItem{
//id
int64 id = 1;
//id-str
string idStr = 2;
//
string lan = 3;
//
string lanDoc = 4;
//url
string subtitleUrl = 5;
//
UserInfo author = 6;
}
//
message UserInfo{
//uid
int64 mid = 1;
//
string name = 2;
//
string sex = 3;
//url
string face = 4;
//
string sign = 5;
//
int32 rank = 6;
}
//
message VideoMask{
//cid
int64 cid = 1;
//
//0:web端 1:app端
int32 plat = 2;
//
int32 fps = 3;
//
int64 time = 4;
//url
string maskUrl = 5;
}
//
message VideoSubtitle{
//
string lan = 1;
//
string lanDoc = 2;
//
repeated SubtitleItem subtitles = 3;
}

View File

@ -0,0 +1,531 @@
syntax = "proto3";
package bilibili.community.service.dm.v1;
//
service DM {
//
rpc DmSegMobile (DmSegMobileReq) returns (DmSegMobileReply);
//
rpc DmView (DmViewReq) returns (DmViewReply);
//
rpc DmPlayerConfig (DmPlayerConfigReq) returns (Response);
// ott弹幕列表
rpc DmSegOtt(DmSegOttReq) returns(DmSegOttReply);
// SDK弹幕列表
rpc DmSegSDK(DmSegSDKReq) returns(DmSegSDKReply);
}
// SDK-
message DmSegSDKReq {
// 稿avid/epid
int64 pid = 1;
// cid/cid
int64 oid = 2;
//
// 1: 2:
int32 type = 3;
// (6min)
int64 segment_index = 4;
}
// SDK-
message DmSegSDKReply {
//
// 0: 1:
bool closed = 1;
//
repeated DanmakuElem elems = 2;
}
// ott弹幕列表-
message DmSegOttReq {
// 稿avid/epid
int64 pid = 1;
// cid/cid
int64 oid = 2;
//
// 1: 2:
int32 type = 3;
// (6min)
int64 segment_index = 4;
}
// ott弹幕列表-
message DmSegOttReply {
//
// 0: 1:
bool closed = 1;
//
repeated DanmakuElem elems = 2;
}
// -
message DmSegMobileReq{
// 稿avid/epid
int64 pid = 1;
// cid/cid
int64 oid = 2;
//
// 1: 2:
int32 type = 3;
// (6min)
int64 segmentIndex = 4;
//
int32 teenagersMode = 5;
}
// -
message DmSegMobileReply{
//
repeated DanmakuElem elems = 1;
//
// 0: 1:
int32 state = 2;
// ai评分值
DanmakuAIFlag aiFlag = 3;
}
// -
message DmViewReq {
// 稿avid/epid
int64 pid = 1;
// cid/cid
int64 oid = 2;
//
// 1: 2:
int32 type = 3;
// spm
string spmid = 4;
//
int32 isHardBoot = 5;
}
// -
message DmViewReply{
//
// 0: 1:
bool closed = 1;
//
VideoMask mask = 2;
//
VideoSubtitle subtitle = 3;
// url(bfs)
repeated string specialDms = 4;
//
DanmakuFlagConfig aiFlag = 5;
//
DanmuPlayerViewConfig playerConfig = 6;
//
int32 sendBoxStyle = 7;
//
bool allow = 8;
// check box
string checkBox = 9;
// check box
string checkBoxShowMsg = 10;
//
string textPlaceholder = 11;
//
string inputPlaceholder = 12;
// cid维度屏蔽的正则规则
repeated string report_filter_content = 13;
}
// web端弹幕元数据-
message DmWebViewReply {
//
// 0: 1:
int32 state = 1;
//
string text = 2;
//
string text_side = 3;
//
DmSegConfig dm_sge = 4;
//
DanmakuFlagConfig flag = 5;
// url(bfs)
repeated string special_dms = 6;
// check box
bool check_box = 7;
//
int64 count = 8;
//
repeated CommandDm commandDms = 9;
//
DanmuWebPlayerConfig player_config = 10;
// cid维度屏蔽
repeated string report_filter_content = 11;
}
//
message CommandDm {
// id
int64 id = 1;
// cid
int64 oid = 2;
// mid
string mid = 3;
//
string command = 4;
//
string content = 5;
//
int32 progress = 6;
//
string ctime = 7;
//
string mtime = 8;
// json数据
string extra = 9;
// id str类型
string idStr = 10;
}
//
message DmSegConfig {
//
int64 page_size = 1;
//
int64 total = 2;
}
//
message VideoMask {
// cid
int64 cid = 1;
//
// 0:web端 1:
int32 plat = 2;
//
int32 fps = 3;
//
int64 time = 4;
// url
string maskUrl = 5;
}
//
message VideoSubtitle {
//
string lan = 1;
//
string lanDoc = 2;
//
repeated SubtitleItem subtitles = 3;
}
// web端用户弹幕配置
message DanmuWebPlayerConfig {
//
bool dm_switch = 1;
//
bool ai_switch = 2 ;
//
int32 ai_level = 3 ;
//
bool blocktop = 4 ;
//
bool blockscroll = 5 ;
//
bool blockbottom = 6 ;
//
bool blockcolor = 7 ;
//
bool blockspecial = 8 ;
//
bool preventshade = 9 ;
//
bool dmask = 10 ;
//
float opacity = 11 ;
//
int32 dmarea = 12 ;
//
float speedplus = 13 ;
//
float fontsize = 14 ;
//
bool screensync = 15 ;
//
bool speedsync = 16 ;
//
string fontfamily = 17 ;
//
bool bold = 18 ;
//
int32 fontborder = 19 ;
//
string draw_type = 20 ;
}
//
message SubtitleItem {
// id
int64 id = 1;
// id str
string idStr = 2;
//
string lan = 3;
//
string lanDoc = 4;
// url
string subtitleUrl = 5;
//
UserInfo author = 6;
}
//
message UserInfo {
// mid
int64 mid = 1;
//
string name = 2;
//
string sex = 3;
// url
string face = 4;
//
string sign = 5;
//
int32 rank = 6;
}
//
message DanmakuElem {
// dmid
int64 id = 1;
// (ms)
int32 progress = 2;
//
int32 mode = 3;
//
int32 fontsize = 4;
//
uint32 color = 5;
// mid hash
string midHash = 6;
//
string content = 7;
//
int64 ctime = 8;
// :[1,10]
int32 weight = 9;
//
string action = 10;
//
int32 pool = 11;
// dmid str
string idStr = 12;
// (bin求AND)
// bit0: bit1: bit2:
int32 attr = 13;
}
//
enum DMAttrBit {
//
DMAttrBitProtect = 0;
//
DMAttrBitFromLive = 1;
//
DMAttrHighLike = 2;
}
// -
message DmPlayerConfigReq {
//
int64 ts = 1;
//
PlayerDanmakuSwitch switch = 2;
//
PlayerDanmakuSwitchSave switchSave = 3;
// 使
PlayerDanmakuUseDefaultConfig useDefaultConfig = 4;
//
PlayerDanmakuAiRecommendedSwitch aiRecommendedSwitch = 5;
//
PlayerDanmakuAiRecommendedLevel aiRecommendedLevel = 6;
//
PlayerDanmakuBlocktop blocktop = 7;
//
PlayerDanmakuBlockscroll blockscroll = 8;
//
PlayerDanmakuBlockbottom blockbottom = 9;
//
PlayerDanmakuBlockcolorful blockcolorful = 10;
//
PlayerDanmakuBlockrepeat blockrepeat = 11;
//
PlayerDanmakuBlockspecial blockspecial = 12;
//
PlayerDanmakuOpacity opacity = 13;
//
PlayerDanmakuScalingfactor scalingfactor = 14;
//
PlayerDanmakuDomain domain = 15;
//
PlayerDanmakuSpeed speed = 16;
//
PlayerDanmakuEnableblocklist enableblocklist = 17;
//
InlinePlayerDanmakuSwitch inlinePlayerDanmakuSwitch = 18;
}
// -
message Response {
//
int32 code = 1;
//
string message = 2;
}
// ai云屏蔽条目
message DanmakuFlag {
// dmid
int64 dmid = 1;
//
uint32 flag = 2;
}
//
message DanmakuFlagConfig {
//
int32 rec_flag = 1;
//
string rec_text = 2;
//
int32 rec_switch = 3;
}
// ai云屏蔽列表
message DanmakuAIFlag {
// ai云屏蔽条目
repeated DanmakuFlag dm_flags = 1;
}
//
message DanmuPlayerViewConfig {
//
DanmuDefaultPlayerConfig danmukuDefaultPlayerConfig = 1;
//
DanmuPlayerConfig danmukuPlayerConfig = 2;
//
repeated DanmuPlayerDynamicConfig danmukuPlayerDynamicConfig = 3;
}
//
message DanmuDefaultPlayerConfig {
// 使
bool player_danmaku_use_default_config = 1;
//
bool player_danmaku_ai_recommended_switch = 4;
//
int32 player_danmaku_ai_recommended_level = 5;
//
bool player_danmaku_blocktop = 6;
//
bool player_danmaku_blockscroll = 7;
//
bool player_danmaku_blockbottom = 8;
//
bool player_danmaku_blockcolorful = 9;
//
bool player_danmaku_blockrepeat = 10;
//
bool player_danmaku_blockspecial = 11;
//
float player_danmaku_opacity = 12;
//
float player_danmaku_scalingfactor = 13;
//
float player_danmaku_domain = 14;
//
int32 player_danmaku_speed = 15;
//
bool inline_player_danmaku_switch = 16;
}
//
message DanmuPlayerConfig {
//
bool player_danmaku_switch = 1;
//
bool player_danmaku_switch_save = 2;
// 使
bool player_danmaku_use_default_config = 3;
//
bool player_danmaku_ai_recommended_switch = 4;
//
int32 player_danmaku_ai_recommended_level = 5;
//
bool player_danmaku_blocktop = 6;
//
bool player_danmaku_blockscroll = 7;
//
bool player_danmaku_blockbottom = 8;
//
bool player_danmaku_blockcolorful = 9;
//
bool player_danmaku_blockrepeat = 10;
//
bool player_danmaku_blockspecial = 11;
//
float player_danmaku_opacity = 12;
//
float player_danmaku_scalingfactor = 13;
//
float player_danmaku_domain = 14;
//
int32 player_danmaku_speed = 15;
//
bool player_danmaku_enableblocklist = 16;
//
bool inline_player_danmaku_switch = 17;
//
int32 inline_player_danmaku_config = 18;
}
//
message DanmuPlayerDynamicConfig {
//
int32 progress = 1;
//
float playerDanmakuDomain = 2;
}
//
message PlayerDanmakuSwitch {bool value = 1;}
//
message PlayerDanmakuSwitchSave {bool value = 1;}
// 使
message PlayerDanmakuUseDefaultConfig {bool value = 1;}
//
message PlayerDanmakuAiRecommendedSwitch {bool value = 1;}
//
message PlayerDanmakuAiRecommendedLevel {bool value = 1;}
//
message PlayerDanmakuBlocktop {bool value = 1;}
//
message PlayerDanmakuBlockscroll {bool value = 1;}
//
message PlayerDanmakuBlockbottom {bool value = 1;}
//
message PlayerDanmakuBlockcolorful {bool value = 1;}
//
message PlayerDanmakuBlockrepeat {bool value = 1;}
//
message PlayerDanmakuBlockspecial {bool value = 1;}
//
message PlayerDanmakuOpacity {float value = 1;}
//
message PlayerDanmakuScalingfactor {float value = 1;}
//
message PlayerDanmakuDomain {float value = 1;}
//
message PlayerDanmakuSpeed {int32 value = 1;}
//
message PlayerDanmakuEnableblocklist {bool value = 1;}
//
message InlinePlayerDanmakuSwitch {bool value = 1;}

View File

@ -3,23 +3,32 @@
注:
1. proto结构体文件按照包名分类同级放在同一目录中
2. 暂时无说明文档,稍后添加
3. 以下文件全部来自apk的逆向工程如有疏漏请包涵
## grpc主机
B站客户端的grpc接口主机为以下服务器
> grpc.biliapi.net
>
> app.bilibili.com
## grpc鉴权
需要在请求http头部中添加`access_key`,如下
```
authorization:identify_v1 {access_key}
```
## grpc头部
- [bilibili.metadata](bilibili/metadata.proto):环境参数
- [bilibili.rpc](bilibili/rpc.proto):响应错误信息
- [bilibili.metadata](bilibili/metadata)客户端环境参数
- [bilibili.rpc](bilibili/rpc/status.proto):响应错误信息
## 接口请求定义
- [blibili.app.archive.v1](bilibili/app/archive/v1.proto):稿件信息
- [bilibili.app.card.v1](bilibili/app/card/v1.proro):卡片
- [blibili.app.playurl.v1](bilibili/app/playurl/v1.proto)APP端视频播放业务
- [blibili.app.show.v1.Popular](bilibili/app/show/popular/v1.proto):热门内容
- [blibili.app.show.v1.Rank](bilibili/app/show/rank/v1.proto):榜单
- [blibili.app.view.v1](bilibili/app/view/v1.proto):稿件详情页
- [bilibili.cheese.gateway.player.v1](bilibili/cheese/gateway/player/v1.proto)APP端课程播放
- [bilibili.pgc.gateway.player.v2](bilibili/pgc/gateway/player/v2.proto)APP端PGC播放
- [bilibili.community.service.dm.v1](bilibili/community/service/dm/v1.proto):弹幕
- [bilibili.main.community.reply.v1](bilibili/main/community/reply/v1.proto):评论区
*稍后补充*

View File

@ -34,7 +34,7 @@
**示例:**
以下信息代表了为未关注用户未读私信数为`10`条,已关注用户未读私信数为`3`条
以下信息代表了为未关注用户未读私信数为`1`条,已关注用户未读私信数为`6`条
```shell
curl 'http://api.vc.bilibili.com/session_svr/v1/session_svr/single_unread' \