添加若干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{
}

View File

@ -0,0 +1,65 @@
//APP端课程播放v1接口
syntax = "proto3";
package bilibili.cheese.gateway.player.v1;
import public "bilibili/app/playurl_v1.proto";
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;
}
//url
//https://app.bilibili.com/bilibili.cheese.gateway.player.v1.PlayURL/PlayView
//
message playViewReq{
enum CodeType{
NOCODE = 0;
CODE264 = 1;
CODE265 = 2;
}
int64 epid = 1; //epid
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;
int32 teenagersMode = 11;
CodeType codetype = 12; //
bool isPreview = 13;
}
//
message PlayViewReply{
bilibili.app.playurl.v1.VideoInfo info = 1; //
PlayAbilityConf PlayConf = 2; //
}

View File

@ -0,0 +1,340 @@
//v1接口
syntax = "proto3";
package bilibili.main.community.reply.v1;
import "google/protobuf/any.proto";
message CursorReq{
enum Mode{
DEFAULT = 0;
UNSPECIFIED = 1;
MAIN_LIST_TIME = 2;
MAIN_LIST_HOT = 3;
}
int64 next = 1;
int64 prev = 2;
Mode mode = 3; //
}
message CursorReply{
enum Mode{
DEFAULT = 0;
UNSPECIFIED = 1;
MAIN_LIST_TIME = 2;
MAIN_LIST_HOT = 3;
}
int64 next = 1;
int64 prev = 2;
bool isBegin = 3;
bool isEnd = 4;
Mode mode = 5;
}
enum SearchItemType{
DEFAULT_ITEM_TYPE = 0;
GOODS_VALUE = 1;
VIDEO_VALUE = 2;
ARTICLE_VALUE = 3;
}
message SearchItemCursorReq{
int64 next = 1;
SearchItemType itemType = 2;
}
message SearchItemCursorReply{
bool hasNext = 1;
int64 next = 2;
}
message Member{
int64 mid = 1; //UID
string name = 2; //
string sex = 3; //
string face = 4; //url
int64 level = 5; //
int64 officialVerifyType = 6; //
int64 vipType = 7; //
int64 vipStatus = 8; //
int64 vipThemeType = 9;
string vipLabelPath = 10;
string garbPendantImage = 11; //url
string garbCardImage = 12; //url
string garbCardImageWithFocus = 13;
string garbCardJumpUrl = 14;//url
string garbCardNumber = 15;//id
string garbCardFanColor = 16;//id显示颜色
bool garbCardIsFan = 17;//
string fansMedalName = 18;
int64 fansMedalLevel = 19;
int64 fansMedalColor = 20;
}
message Content{
message Emote{
int64 size = 1;// 1: 2:
string url = 2;//url
}
message Topic{
string link = 1;
int64 id = 2;
}
message Url{
string title = 1; //
int64 state = 2;
string prefixIcon = 3; //url
string appUrlSchema = 4;
string appName = 5;
string appPackageName = 6;
string clickReport = 7;
}
message Vote{
int64 id = 1;
string title = 2;
int64 count = 3;
}
string message = 1; //
map<string,Member> menber = 2; //at到的用户信息
map<string,Emote> emote = 3; //
map<string,Topic> topic = 4; //
map<string,Url> url = 5; //
Vote vote = 6;
}
message ReplyControl{
int64 action = 1; // 0: 1: 2:
bool upLike = 2; //UP觉得很赞
bool upReply = 3; //UP回复
bool showFollowBtn = 4; //
bool isAssist = 5;
string labelText = 6;
bool following = 7; //
bool followed = 8; //
bool blocked = 9;
bool hasFoldedReply = 10;
bool isFoldedReply = 11;
bool isUpTop = 12; //UP置顶
bool isAdminTop = 13; //
bool isVoteTop = 14; //
int64 maxLine = 15; //
bool invisible = 16;
}
message ReplyInfo{
repeated ReplyInfo replies = 1; //
int64 id = 2; //rpid
int64 oid = 3; //id
int64 type = 4; //id
int64 mid = 5; //UID
int64 root = 6; //rpid
int64 parent = 7; //rpid
int64 dialog = 8; //rpid
int64 like = 9; //
int64 ctime = 10; //
int64 count = 11; //
Content content = 12; //
Member member = 13; //
ReplyControl replyControl = 14; //
}
message SubjectControl{
int64 upMid = 1; //UP主UID
bool isAssist = 2;
bool readOnly = 3;
bool hasVoteAccess = 4;
bool hasLotteryAccess = 5;
bool hasFoldedReply = 6;
string bgText = 7; //
bool upBlocked = 8;
bool hasActivityAccess = 9;
bool showTitle = 10;
bool showUpAction = 11;
int64 switcherType = 12;
bool inputDisable = 13;
string rootText = 14; //
string childText = 15;
int64 count = 16; //
string title = 17; //
}
message Notice{
int64 id = 1;
string content = 2;
string link = 3;
}
message Lottery{
int64 lotteryId = 1;
int64 lotteryStatus = 2;
int64 lotteryMid = 3;
int64 lotteryTime = 4;
int64 oid = 5;
int64 type = 6;
int64 ctime = 7;
Content content = 8;
Member member = 9;
ReplyControl replyControl = 10;
}
message Activity{
int64 activityId = 1;
int64 activityState = 2;
string activityPlaceholder = 3;
}
message UpSelection{
int64 pendingCount = 1;
int64 ignoreCount = 2;
}
message CM{
google.protobuf.Any sourceContent = 1;
}
message SearchItem{
message ArticleSearchItem{
string title = 1;
string upNickname = 2;
repeated string covers = 3;
}
message GoodsSearchItem{
int64 id = 1;
string name = 2;
string price = 3;
string income = 4;
string img = 5;
string label = 6;
}
message VideoSearchItem{
enum VideoItemCase{
VIDEOITEM_NOT_SET = 0;
UGC = 2;
PGC = 3;
}
message UGCVideoSearchItem{
string title = 1;
string upNickname = 2;
int64 duration = 3;
string cover = 4;
}
message PGCVideoSearchItem{
string title = 1;
string category = 2;
string cover = 3;
}
VideoItemCase type = 1;
UGCVideoSearchItem UGCVideo = 2;
PGCVideoSearchItem PGCVideo = 3;
}
enum ItemCase{
ITEM_NOT_SET = 0;
GOODS = 2;
VIDEO = 3;
ARTICLE = 4;
}
string url = 1;
GoodsSearchItem goods = 2;
VideoSearchItem video = 3;
ArticleSearchItem article = 4;
}
message SearchItemReplyExtraInfo{
string eventId = 1;
}
//
//https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/MainList
//
message MainListReq{
int64 oid = 1; //id
int64 type = 2; //
CursorReq cursor = 3; //
string extra = 4;
string adExtra = 5;
int64 rpid = 6;
}
//
message MainListReply{
CursorReply cursor = 1; //
repeated ReplyInfo replies = 2; //
SubjectControl subjectControl = 3; //
ReplyInfo upTop = 4; //UP置顶评论
ReplyInfo adminTop = 5; //
ReplyInfo voteTop = 6; //
Notice notice = 7;
Lottery lottery = 8; //
Activity activity = 9;
UpSelection upSelection = 10;
CM cm = 11;
}
//
//https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/DetailList
//
message DetailListReq{
enum DetailListScene{
REPLY = 0; //
MSG_FEED = 1; //
}
int64 oid = 1; //id
int64 type = 2; //
int64 root = 3; //rpid
int64 rpid = 4; //rpid
CursorReq cursor = 5; //
DetailListScene scene = 6; //
}
//
message DetailListReply{
CursorReply cursor = 1; //
SubjectControl subjectControl = 2; //
ReplyInfo root = 3; //()
Activity activity = 4;
}
//
//https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/DialogList
//
message DialogListReq{
int64 oid = 1; //id
int64 type = 2; //
int64 root = 3; //rpid
int64 rpid = 4; //rpid
CursorReq cursor = 5; //
}
//
message DialogListReply{
CursorReply cursor = 1; //
SubjectControl subjectControl = 2; //
repeated ReplyInfo replies = 3; //
Activity activity = 4;
}
//
//https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/SearchItemPreHook
//
message SearchItemPreHookReq{
int64 oid = 1; //id
int64 type = 2; //
}
//
message SearchItemPreHookReply{
string placeholderText = 1;
string backgroundText = 2;
repeated SearchItemType orderedType = 3;
}
//
//https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/SearchItem
//
message SearchItemReq{
SearchItemCursorReq cursor = 1; //
int64 oid = 2; //id
int64 type = 3; //
string keyword = 4; //
}
//
message SearchItemReply{
SearchItemCursorReply cursor = 1;
repeated SearchItem items = 2;
SearchItemReplyExtraInfo extra = 3;
}

View File

@ -0,0 +1,20 @@
syntax = "proto3";
package bilibili.metadata.device;
//1
//x-bili-device-bin
message Device{
int32 appId = 1;
int32 build = 2;
string buvid = 3;
string mobiApp = 4;
string platform = 5;
string device = 6;
string channel = 7;
string brand = 8;
string model = 9;
string osver = 10;
string fpLocal = 11;
string fpRemote = 12;
string versionName = 13;
}

View File

@ -0,0 +1,10 @@
syntax = "proto3";
package bilibili.metadata.locale;
//
//x-bili-locale-bin
message LocaleIds{
string language = 1;
string script = 2;
string region = 3;
}

View File

@ -0,0 +1,23 @@
syntax = "proto3";
package bilibili.metadata;
//2
//x-bili-metadata-bin
message Metadata{
string accessKey = 1;
string mobiApp = 2;
string device = 3;
int32 build = 4;
string channel = 5;
string buvid = 6;
string platform = 7;
}
import "google/protobuf/any.proto";
//
//grpc-status-details-bin
message Status{
int32 code = 1; //
string message = 2; //
repeated google.protobuf.Any details = 3; //
}

View File

@ -0,0 +1,25 @@
syntax = "proto3";
package bilibili.metadata.network;
enum Type{
NT_UNKNOWN = 0;
WIFI = 1; //wifi
CELLULAR = 2; //
OFFLINE = 3; //线
ETHERNET = 5; //
OTHERNET = 4; //
}
/*
enum Tf{
}*/
//
//x-bili-network-bin
message Network{
Type type = 1; //
//Tf tf = 2;
int32 tf = 2;
string oid = 3;
}

View File

@ -0,0 +1,8 @@
syntax = "proto3";
package bilibili.metadata.restriction;
enum ModeType{
NORMAL = 0;
TEENAGERS = 1;
LESSONS = 2;
}

View File

@ -0,0 +1,245 @@
//APP端PGC播放v2接口
//https://app.bilibili.com/bilibili.pgc.gateway.player.v2.PlayURL/PlayView
syntax = "proto3";
package bilibili.pgc.gateway.player.v2;
import "google/protobuf/timestamp.proto";
message playViewReq{
enum CodeType{
NOCODE = 0;
CODE264 = 1;
CODE265 = 2;
}
int64 epid = 1; //epid
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;
int32 teenagersMode = 11;
CodeType codetype = 12; //
bool isPreview = 13;
int64 roomId = 14;
bool isNeedViewInfo = 15;
}
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 PlayViewBusinessInfo{
bool isPreview=1;
bool bp=2;
string marlinToken=3;
}
message Event{
message Shake{
string file=1;
}
Shake shake=1;
}
message ViewInfo{
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;
}
message Dialog{
message DialogConfig{
bool isShowCover=1;
bool isOrientationEnable=2;
bool isNestedScrollEnable=3;
bool isForceHalfscreenEnable=4;
}
message TextInfo{
string text=1;
string textColor=2;
string textColorNight=3;
}
message ImageInfo{
string url=1;
}
int64 code=1;
string msg=2;
string type=3;
string styleType=4;
DialogConfig config=5;
TextInfo title=6;
TextInfo subtitle=7;
ImageInfo image=8;
repeated ButtonInfo button=9;
ButtonInfo bottomDesc=10;
Report report=11;
int32 countDownSec=12;
}
message Toast{
string text=1;
ButtonInfo button=2;
}
message CouponInfo{
message CouponToast{
message CouponTextInfo{
string positivePreview=1;
string section=2;
}
CouponTextInfo textInfo=1;
ButtonInfo button=2;
}
message PopWin{
message Coupon{
string couponToken=1;
int64 type=2;
string value=3;
string useDesc=4;
string title=5;
string desc=6;
string payButtonText=7;
string payButtonTextLineThrough=8;
string realAmount=9;
google.protobuf.Timestamp expireTime=10;
}
string title=1;
repeated Coupon coupon=2;
repeated ButtonInfo button=3;
string bottomText=4;
}
CouponToast toast=1;
PopWin popWin=2;
}
message EndPage{
Dialog dialog=1;
bool hide=2;
}
Dialog dialog=1;
Toast toast=2;
CouponInfo couponInfo=3;
repeated int64 demandNoPayEpids=4;
EndPage endPage=5;
}
message PlayViewReply{
VideoInfo info=1;//
PlayAbilityConf PlayConf=2;//
PlayViewBusinessInfo Business=3;
Event event=4;
ViewInfo viewInfo=5;
}

View File

@ -0,0 +1,12 @@
syntax = "proto3";
package bilibili.rpc;
import "google/protobuf/any.proto";
//
//grpc-status-details-bin
message Status{
int32 code = 1; //
string message = 2; //
repeated google.protobuf.Any details = 3; //
}

8
grpc_api/comp_proto.bat Normal file
View File

@ -0,0 +1,8 @@
@ echo off
rem 递归编译proto
set lang="python"
set patch=%CD%
for /r %patch% %%a in (*.proto) do (
protoc.exe -I %patch% --%lang%_out=. %%~fa
echo comp %%~fa ok!
)

27
grpc_api/readme.md Normal file
View File

@ -0,0 +1,27 @@
# grpc接口定义protobuf结构体
- `comp_proto.bat`---win递归批量编译脚本
注:
1. proto结构体文件按照包名分类同级放在同一目录中
2. 暂时无说明文档,稍后添加
3. 以下文件全部来自apk的逆向工程如有疏漏请包涵
## grpc头部
- [bilibili.metadata.locale](bilibili/metadata/locale.proto):区域信息
- [bilibili.metadata.network](bilibili/metadata/network.proto):网络信息
- [bilibili.metadata](bilibili/metadata/metadata.proto):环境参数
- [bilibili.metadata.restriction](bilibili/metadata/restriction.proto):限制值
- [bilibili.metadata.device](bilibili/metadata/device.proto):设备信息
- [bilibili.rpc](bilibili/rpc.proto):响应错误信息
## 接口请求定义
- [blibili.app.archive.v1](bilibili/app/archive_v1.proto)稿件信息v1模块
- [blibili.app.playurl.v1](bilibili/app/playurl_v1.proto)APP端视频播放v1接口
- [blibili.app.view.v1](bilibili/app/view_v1.proto)视频页v1接口
- [bilibili.pgc.gateway.player.v2](bilibili/pgc/gateway_player_v2.proto)APP端PGC播放v2接口
- [bilibili.cheese.gateway.player.v1](bilibili/cheese_gateway_player_v1.proto)APP端课程播放v1接口
- [bilibili.main.community.reply.v1](bilibili/main_community_reply_v1.proto)评论区v1接口