添加若干grpc接口的proto定义

This commit is contained in:
SocialSisterYi
2021-01-03 15:41:20 +08:00
parent 27a5968ebc
commit fe77d8aae7
14 changed files with 1767 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
//稿件信息v1模块
syntax = "proto3";
package bilibili.app.archive.v1;
//用户信息
message Author{
int64 mid = 1;//UID
string name = 2;//昵称
string face = 3;//头像url
}
//分辨率信息
message Dimension{
int64 width = 1;//宽
int64 height = 2;//高
int64 rotate = 3;//旋转
}
//分P视频
message Page{
int64 cid = 1;//cid
int32 page = 2;//分P
string from = 3;//源类型
string part = 4;
int64 duration = 5;
string vid = 6;
string desc = 7;
string webLink = 8;
Dimension dimension = 9;//分辨率
}
//允许配置
message Rights{
int32 bp = 1;
int32 elec = 2;
int32 download = 3;
int32 movie = 4;
int32 pay = 5;
int32 hd5 = 6;
int32 noReprint = 7;
int32 autoplay = 8;
int32 ugcPay = 9;
int32 isCooperation = 10;
int32 ugcPayPreview = 11;
int32 noBackground = 12;
}
//合作成员
message StaffInfo{
int64 mid = 1;//UID
string title = 2;//成员备注
int64 attribute = 3;//
}
//状态数
message Stat{
int64 aid = 1;//avid
int32 view = 2;//播放
int32 danmaku = 3;//弹幕
int32 reply = 4;//评论
int32 fav = 5;//收藏
int32 coin = 6;//投币
int32 share = 7;//分享
int32 nowRank = 8;//当前排名
int32 hisRank = 9;//历史最好排名
int32 like = 10;//点赞
int32 dislike = 11;//点踩
}
//稿件基本信息
message Arc{
int64 aid = 1; //稿件avid
int64 videos = 2; //稿件分P数
int32 typeId = 3; //分区tid
string typeName = 4; //子分区名
int32 copyright = 5; //稿件类型
string pic = 6; //稿件封面url
string title = 7; //稿件标题
int64 pubdate = 8;
int64 ctime = 9;
string desc = 10; //简介
int32 state = 11; //稿件状态
int32 access = 12;
int32 attribute = 13; //属性位配置
string tag = 14;
repeated string tags = 15;
int64 duration = 16; //总时长
int64 missionId = 17; //参与的活动id
int64 orderId = 18;
string redirectUrl = 19; //重定向url
int64 forward = 20;
Rights rights = 21;
Author author = 22; //UP主信息
Stat stat = 23; //状态数
string reportResult = 24;
string dynamic = 25; //动态内容
int64 firstCid = 26; //1P cid
Dimension dimension = 27; //1P 分辨率
repeated StaffInfo staffInfo = 28; //合作组成员列表
int64 seasonId = 29;
int64 attributeV2 = 30;
}

View File

@@ -0,0 +1,213 @@
//APP端视频播放v1接口
syntax = "proto3";
package bilibili.app.playurl.v1;
message VideoInfo{
message stream{
message streamInfo{
message Limit{
string title=1;
string uri=2;
string msg=3;
}
uint32 quality=1;//清晰度
string format=2;//格式
string description=3;//格式描述
uint32 errCode=4;
Limit limit=5;
bool needVip=6;//需要vip
bool needLogin=7;//需要登录
bool intact=8;
bool noRexcode=9;
int64 attribute=10;
string newDescription=11;//新版格式描述
string displayDesc=12;//格式文字
string superscript=13;//新版格式描述备注
}
message DashVideo{
string baseUrl=1;//主线流
repeated string backupUrl=2;//备用流
uint32 bandwidth=3;//带宽
uint32 codecid=4;
string md5=5;//md5
uint64 size=6;//大小
uint32 audioId=7;
bool noRexcode=8;
}
message SegmentVideo{
message ResponseUrl{
uint32 order=1;
uint64 length=2;
uint64 size=3;
string url=4;
repeated string backupUrl=5;
string md5=6;
}
repeated ResponseUrl segment=1;
}
streamInfo info=1;//元数据
DashVideo dashvideo=2;//dash流
SegmentVideo segmentvideo=3;//flv流
}
message DashAudio{
uint32 id=1;
string baseUrl=2;//主线流
repeated string backupUrl=3;//备用流
uint32 bandwidth=4;//带宽
uint32 codecid=5;//
string md5=6;//md5
uint64 size=7;//大小
}
message DolbyItem{
int32 type=1;
DashAudio audio=2;
}
uint32 quality=1;//视频清晰度
string format=2;//视频格式
uint64 timelength=3;//视频时长
uint32 videoCodecid=4;//
repeated stream streamList=5;//视频流
repeated DashAudio audio=6;//伴音流
DolbyItem dolby=7;//杜比伴音流
}
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;
}
message UpgradeLimit{
message Report{
string showEventId=1;
string clickEventId=2;
string extends=3;
}
message ButtonInfo{
message BadgeInfo{
string text=1;
string bgColor=2;
string bgColorNight=3;
}
string text=1;
string textColor=2;
string textColorNight=3;
string bgColor=4;
string bgColorNight=5;
string link=6;
string actionType=7;
BadgeInfo badgeInfo=8;
Report report=9;
}
int32 code =1;
string message =2;
string image =3;
ButtonInfo button=4;
}
message Chronos{
string md5=1;
string file=2;
}
message PlayArcConf{
message ArcConf{
bool isSupport=1;
}
ArcConf backgroundPlayConf=1;
ArcConf flipConf=2;
ArcConf castConf=3;
ArcConf feedbackConf=4;
ArcConf subtitleConf=5;
ArcConf playbackRateConf=6;
ArcConf timeUpConf=7;
ArcConf playbackModeConf=8;
ArcConf scaleModeConf=9;
ArcConf likeConf=10;
ArcConf dislikeConf=11;
ArcConf coinConf=12;
ArcConf elecConf=13;
ArcConf shareConf=14;
ArcConf screenShotConf=15;
ArcConf lockScreenConf=16;
ArcConf recommendConf=17;
ArcConf playbackSpeedConf=18;
ArcConf definitionConf=19;
ArcConf selectionsConf=20;
ArcConf nextConf=21;
ArcConf editDmConf=22;
ArcConf smallWindowConf=23;
ArcConf shakeConf=24;
ArcConf outerDmConf=25;
ArcConf innerDmConf=26;
ArcConf freyaEnterConf=27;
ArcConf dolbyConf=28;
}
message Event{
message Shake{
string file=1;
}
Shake shake=1;
}
//获取视频url
//https://app.bilibili.com/bilibili.app.playurl.v1.PlayURL/PlayView
//请求
message PlayURLReq{
int64 aid = 1; //avid
int64 cid = 2; //cid
int64 qn = 3; //清晰度
int32 fnver = 4; //流类型
int32 fnval = 5;
uint32 download = 6; //下载配置 0:播放 1:flv下载 2:dash下载
int32 forceHost = 7;
bool fourk = 8; //是否4K
string spmid = 9;
string fromSpmid = 10;
}
//回复
message PlayViewReply{
VideoInfo info = 1; //视频信息
PlayAbilityConf PlayConf = 2; //播放界面配置
UpgradeLimit upgradeLimit = 3;
Chronos chronos = 4;
PlayArcConf playArc = 5;
Event event = 6;
}
//获取播放界面配置
//https://app.bilibili.com/bilibili.app.playurl.v1.PlayURL/PlayConf
//请求
message PlayConfReq{
}
//回复
message PlayConfReply{
PlayAbilityConf playConf = 1;
}

View File

@@ -0,0 +1,669 @@
//视频页v1接口
syntax = "proto3";
package bilibili.app.view.v1;
import "google/protobuf/any.proto";
import public "bilibili/app/archive_v1.proto";
message ActivityResource{
string modPoolName = 1;
string modResourceName = 2;
string bgColor = 3;
string selectedBgColor = 4;
string textColor = 5;
string lightTextColor = 6;
string darkTextColor = 7;
string dividerColor = 8;
}
message Attention{
int32 startTime = 1;
int32 endTime = 2;
double posX = 3;
double posY = 4;
}
message ActivitySeason{
bilibili.app.archive.v1.Arc arc = 1;
repeated ViewPage pages = 2;
OnwerExt ownerExt = 3;
ReqUser reqUser = 4;
ElecRank elecRank = 5;
History history = 6;
string bvid = 7;
Honor honor = 8;
repeated Staff staff = 9;
UgcSeason ugcSeason = 10;
Tab tab = 11;
Rank rank = 12;
Order order = 13;
bool supportDislike = 14;
OperationRelate operationRelate = 15;
ActivityResource activityResource = 16;
string shortLink = 17;
Label label = 18;
Dislike dislike = 19;
PlayerIcon playerIcon = 20;
string shareSubtitle = 21;
CMConfig cmConfig = 22;
TFPanelCustomized tfPanelCustomized = 23;
string argueMsg = 24;
ECode ecode = 25;
CustomConfig customConfig = 26;
}
message Audio{
string title = 1;
string coverUrl = 2;
int64 songId = 3;
int64 playCount = 4;
int64 replyCount = 5;
int64 upperId = 6;
string entrance = 7;
int64 songAttr = 8;
}
message Bgm {
int64 sid = 1;
int64 mid = 2;
string title = 3;
string author = 4;
string jumpUrl = 5;
string cover = 6;
}
message BizFavSeasonParam{
int64 seasonId = 1;
}
message BizFollowVideoParam{
int64 seasonId = 1;
}
message BizJumpLinkParam{
string url = 1;
}
message BizReserveActivityParam{
int64 activityId = 1;
string from = 2;
string type = 3;
int64 oid = 4;
}
enum BizType{
BizTypeNone = 0;
BizTypeFollowVideo = 1;
BizTypeReserveActivity = 2;
BizTypeJumpLink = 3;
BizTypeFavSeason = 4;
}
message Button{
string title = 1;
string uri = 2;
}
message CM{
google.protobuf.Any sourceContent = 1;
}
message CMConfig {
google.protobuf.Any adsControl = 1;
}
message Chronos{
string md5 = 1;
string file = 2;
}
message CustomConfig {
string redirectUrl = 1;
}
message CommandDm{
int64 id = 1;
int64 oid = 2;
string mid = 3;
string command = 4;
string content = 5;
int32 progress = 6;
string ctime = 7;
string mtime = 8;
string extra = 9;
string idStr = 10;
}
message Config {
string relatesTitle = 1;
int32 relatesStyle = 2;
int32 relateGifExp = 3;
int32 endPageHalf = 4;
int32 endPageFull = 5;
}
message DM{
bool closed = 1;
bool realName = 2;
int64 count = 3;
}
//不喜欢原因项
message Dislike {
string title = 1;
string subtitle = 2;
repeated DislikeReasons reasons = 3;
}
message DislikeReasons{
int64 id = 1;
int64 mid = 2;
int32 rid = 3;
int64 tagId = 4;
string name = 5;
}
enum ECode{
DEFAULT = 0;
CODE404 = 1;
}
message ElecRank {
repeated ElecRankItem list = 1;
int64 count = 2;
}
message ElecRankItem{
string avatar = 1;
string nickname = 2;
string message = 3;
int64 mid = 4;
}
message Episode{
int64 id = 1;
int64 aid = 2;
int64 cid = 3;
string title = 4;
string cover = 5;
string coverRightText = 6;
bilibili.app.archive.v1.Page page = 7;
bilibili.app.archive.v1.Stat stat = 8;
string bvid = 9;
}
message History {
int64 cid = 1;
int64 progress = 2;
}
message Honor {
string icon = 1;
string iconNight = 2;
string text = 3;
string textExtra = 4;
string textColor = 5;
string textColorNight = 6;
string bgColor = 7;
string bgColorNight = 8;
string url = 9;
string urlText = 10;
}
message Interaction {
Node historyNode = 1;
int64 graphVersion = 2;
string msg = 3;
string evaluation = 4;
int64 mark = 5;
}
message Label {
int32 type = 1;
string uri = 2;
}
message Live{
int64 mid = 1;
int64 roomid = 2;
string uri = 3;
}
message Node{
int64 nodeId = 1;
string title = 2;
int64 cid = 3;
}
message Notice{
string title = 1;
string desc = 2;
}
message OfficialVerify{
int32 type = 1;
string desc = 2;
}
message OnwerExt {
OfficialVerify officialVerify = 1;
Live live = 2;
Vip vip = 3;
repeated int64 assists = 4;
int64 fans = 5;
}
message OperationCard{
int32 startTime = 1;
int32 endTime = 2;
string icon = 3;
string title = 4;
string buttonText = 5;
string url = 6;
string content = 7;
}
message OperationCardNew{
int64 id = 1;
int32 from = 2;
int32 to = 3;
bool status = 4;
OperationCardType cardType = 5;
StandardCard standardCard= 6;
OperationCard operationCard = 7;
BizType bizType = 8;
BizFollowVideoParam FollowVideoParam = 9;
BizReserveActivityParam ReserveActivityParam = 10;
BizJumpLinkParam LinkParam = 11;
}
enum OperationCardType{
CardTypeNone = 0;
CardTypeStandard = 1;
CardTypeSkip = 2;
}
message OperationRelate{
string title = 1;
repeated RelateItem relateItem = 2;
}
message Order{
bool status = 1;
string title = 2;
string buttonTitle = 3;
string buttonSelectedTitle = 4;
int64 seasonStatView = 5;
int64 seasonStatDanmaku = 6;
BizType orderType = 7;
BizReserveActivityParam reserve = 8;
BizFavSeasonParam favSeason = 9;
string intro = 10;
}
message PackInfo{
string title = 1;
string uri = 2;
}
message PlayerIcon {
string url1 = 1;
string hash1 = 2;
string url2 = 3;
string hash2 = 4;
}
message Rank{
string icon = 1;
string iconNight = 2;
string text = 3;
}
message ReasonStyle{
string text = 1;
string textColor = 2;
string bgColor = 3;
string borderColor = 4;
string textColorNight = 5;
string bgColorNight = 6;
string borderColorNight = 7;
int32 bgStyle = 8;
int32 selected = 9;
}
//推荐视频
message Relate {
int64 aid = 1;
string pic = 2;
string title = 3;
bilibili.app.archive.v1.Author author = 4;
bilibili.app.archive.v1.Stat stat = 5;
int64 duration = 6;
string goto = 7;
string param = 8;
string uri = 9;
string jumpUrl = 10;
double rating = 11;
string reserve = 12;
string from = 13;
string desc = 14;
string rcmdReason = 15;
string badge = 16;
int64 cid = 17;
int32 seasonType = 18;
int32 ratingCount = 19;
string tagName = 20;
PackInfo packInfo = 21;
Notice notice = 22;
Button button = 23;
string trackid = 24;
int32 newCard = 25;
ReasonStyle rcmdReasonStyle = 26;
string coverGif = 27;
CM cm = 28;
}
message RelateItem{
string url = 1;
string cover = 2;
}
message RelateTab {
string id = 1;
string title = 2;
}
message ReqUser {
int32 attention = 1;
int32 guestAttention = 2;
int32 favorite = 3;
int32 like = 4;
int32 dislike = 5;
int32 coin = 6;
int32 attentionLevel = 7;
}
message Season {
string allowDownload = 1;
int64 seasonId = 2;
int32 isJump = 3;
string title = 4;
string cover = 5;
int32 isFinish = 6;
int64 newestEpId = 7;
string newestEpIndex = 8;
int64 totalCount = 9;
int32 weekday = 10;
UserSeason userSeason = 11;
SeasonPlayer player = 12;
string ogvPlayurl = 13;
}
message SeasonPlayer{
int64 aid = 1;
string vid = 2;
int64 cid = 3;
string from = 4;
}
message Section{
int64 id = 1;
string title = 2;
int64 type = 3;
repeated Episode episodes = 4;
}
message Staff {
int64 mid = 1;
string title = 2;
string face = 3;
string name = 4;
OfficialVerify officialVerify = 5;
Vip vip = 6;
int32 attention = 7;
int32 labelStyle = 8;
}
message StandardCard{
string title = 1;
string buttonTitle = 2;
string buttonSelectedTitle = 3;
bool showSelected = 4;
}
message TFPanelCustomized{
string rightBtnImg = 1;
string rightBtnText = 2;
string rightBtnTextColor = 3;
string rightBtnLink = 4;
string mainLabel = 5;
string operator = 6;
map<string,subTFPanel> entry = 7;
}
//TAG图标
message TIcon {
string icon = 1;
}
message Tab{
string background = 1;
TabOtype otype = 2;
int64 oid = 3;
string uri = 4;
TabStyle style = 5;
string text = 6;
string textColor = 7;
string textColorSelected = 8;
string pic = 9;
int64 id = 10;
}
enum TabOtype{
UnknownOtype = 0;
URL = 1;
TopicNA = 2;
}
enum TabStyle{
UnknownStyle = 0;
Text = 1;
Pic = 2;
}
//TAG信息
message Tag {
int64 id = 1;
string name = 2;
int64 likes = 3;
int64 hates = 4;
int32 liked = 5;
int32 hated = 6;
string uri = 7;
string tagType = 8;
}
message UgcSeason {
int64 id = 1;
string title = 2;
string cover = 3;
string intro = 4;
repeated Section sections = 5;
UgcSeasonStat stat = 6;
string labelText = 7;
string labelTextColor = 8;
string labelBgColor = 9;
string labelBgNightColor = 11;
string labelTextNightColor = 10;
string descRight = 12;
int64 epCount = 13;
}
message UgcSeasonStat{
int64 seasonId = 1;
int32 view = 2;
int32 danmaku = 3;
int32 reply = 4;
int32 fav = 5;
int32 coin = 6;
int32 share = 7;
int32 nowRank = 8;
int32 hisRank = 9;
int32 like = 10;
}
message UpAct{
int64 sid = 1;
int64 mid = 2;
string title = 3;
string statement = 4;
string image = 5;
string url = 6;
string button = 7;
}
message UserGarb{
string urlImageAniCut = 1;
}
message UserSeason{
string attention = 1;
}
message VideoGuide{
repeated Attention attention = 1; //关注按钮卡片
repeated CommandDm commandDms = 2; //互动弹幕
repeated OperationCard operationCard = 3;
repeated OperationCardNew operationCardNew = 4;
}
//分P明细
message ViewPage {
bilibili.app.archive.v1.Page page = 1;//分P视频
Audio audio = 2;
DM dm =3;
string downloadTitle = 4;
string downloadSubtitle = 5;
}
message Vip{
int32 type = 1;
int64 dueDate = 2;
string dueRemark = 3;
int32 accessStatus = 4;
int32 vipStatus = 5;
string vipStatusWarn = 6;
int32 themeType = 7;
VipLabel label = 8;
}
message VipLabel{
string path = 1;
}
message subTFPanel{
string rightBtnImg = 1;
string rightBtnText = 2;
string rightBtnTextColor = 3;
string rightBtnLink = 4;
string mainLabel = 5;
string operator = 6;
}
//视频页信息
//https://app.bilibili.com/bilibili.app.view.v1.View/View
//请求
message ViewReq {
int64 aid = 1; //avid
string bvid = 2; //bvid
string from = 3;
string trackid = 4;
string adExtra = 5;
int32 qn = 6;
int32 fnver = 7;
int32 fnval = 8;
int32 forceHost = 9;
int32 fourk = 10;
string spmid = 11;
string fromSpmid = 12;
int32 autoplay = 13;
}
//回复
message ViewReply {
bilibili.app.archive.v1.Arc arc = 1; //稿件基本信息
repeated ViewPage pages = 2; //分P信息
OnwerExt ownerExt = 3;
ReqUser reqUser = 4;
repeated Tag tag = 5; //稿件TAG
map<string, TIcon> tIcon = 6; //TAG图标
Season season = 7;
ElecRank elecRank = 8;
History history = 9;
repeated Relate relates = 10; //推荐视频
Dislike dislike = 11; //不喜欢原因项
PlayerIcon playerIcon = 12;
string vipActive_ = 13;
string bvid = 14;//稿件bvid
Honor honor = 15;
repeated RelateTab relateTab = 16;
string activityUrl = 17;
repeated Bgm bgm = 18;
repeated Staff staff = 19;
string argueMsg = 20;//警告信息
string shortLink = 21;
int32 playParam = 22;
Label label = 23;
UgcSeason ugcSeason = 24;
Config config = 25;
string shareSubtitle_ = 26;
Interaction interaction = 27;
int32 ecode = 28;
CustomConfig customConfig = 29;
repeated CM cms = 30;
CMConfig cmConfig = 31;
Tab tab = 32;
Rank rank = 33;
TFPanelCustomized tfPanelCustomized = 34;
UpAct upAct = 35;
UserGarb userGarb = 36;
ActivitySeason activitySeason = 37;
}
//获取视频特殊数据
//https://app.bilibili.com/bilibili.app.view.v1.View/ViewProgress
//请求
message ViewProgressReq{
int64 aid = 1;
int64 cid = 2;
int64 upMid = 3;
}
message ViewProgressReply{
VideoGuide videoGuide = 1; //特殊数据
Chronos chronos = 2; //资源包
}
//
//https://app.bilibili.com/bilibili.app.view.v1.View/ShortFormVideoDownload
//请求
message ShortFormVideoDownloadReq{
int64 aid = 1;
int64 cid = 2;
int64 mid = 3;
string buvid = 4;
string mobiApp = 5;
int64 build = 6;
string device = 7;
string platform = 8;
string spmid = 9;
}
//回复
message ShortFormVideoDownloadReply{
bool hasDownloadUrl = 1;
string downloadUrl = 2;
string md5 = 3;
int64 size = 4;
}
message NoReply{
}