更新大量【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

@@ -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);
// 心跳保活成功心跳为4分45秒重试心跳为30s三次收不到进行重连不超过5分45
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 {
// 冷启动id算法uuid重新起启会变
string guid = 1;
// 连接id算法uuid重连会变
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):评论区
*稍后补充*