XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/bilibili-API-collect

添加若干grpc接口的proto定义

fe77d8a
SocialSisterYi <45892418+SocialSisterYi@users.noreply.github.com>
提交于

代码差异

14 个文件 +1767 -0
Added grpc_api/bilibili/app/archive_v1.proto +102 -0
@@ -0,0 +1,102 @@
1 //稿件信息v1模块
2 syntax = "proto3";
3 package bilibili.app.archive.v1;
4
5 //用户信息
6 message Author{
7 int64 mid = 1;//UID
8 string name = 2;//昵称
9 string face = 3;//头像url
10 }
11
12 //分辨率信息
13 message Dimension{
14 int64 width = 1;//宽
15 int64 height = 2;//高
16 int64 rotate = 3;//旋转
17 }
18
19 //分P视频
20 message Page{
21 int64 cid = 1;//cid
22 int32 page = 2;//分P
23 string from = 3;//源类型
24 string part = 4;
25 int64 duration = 5;
26 string vid = 6;
27 string desc = 7;
28 string webLink = 8;
29 Dimension dimension = 9;//分辨率
30 }
31
32 //允许配置
33 message Rights{
34 int32 bp = 1;
35 int32 elec = 2;
36 int32 download = 3;
37 int32 movie = 4;
38 int32 pay = 5;
39 int32 hd5 = 6;
40 int32 noReprint = 7;
41 int32 autoplay = 8;
42 int32 ugcPay = 9;
43 int32 isCooperation = 10;
44 int32 ugcPayPreview = 11;
45 int32 noBackground = 12;
46 }
47
48 //合作成员
49 message StaffInfo{
50 int64 mid = 1;//UID
51 string title = 2;//成员备注
52 int64 attribute = 3;//
53 }
54
55 //状态数
56 message Stat{
57 int64 aid = 1;//avid
58 int32 view = 2;//播放
59 int32 danmaku = 3;//弹幕
60 int32 reply = 4;//评论
61 int32 fav = 5;//收藏
62 int32 coin = 6;//投币
63 int32 share = 7;//分享
64 int32 nowRank = 8;//当前排名
65 int32 hisRank = 9;//历史最好排名
66 int32 like = 10;//点赞
67 int32 dislike = 11;//点踩
68 }
69
70 //稿件基本信息
71 message Arc{
72 int64 aid = 1; //稿件avid
73 int64 videos = 2; //稿件分P数
74 int32 typeId = 3; //分区tid
75 string typeName = 4; //子分区名
76 int32 copyright = 5; //稿件类型
77 string pic = 6; //稿件封面url
78 string title = 7; //稿件标题
79 int64 pubdate = 8;
80 int64 ctime = 9;
81 string desc = 10; //简介
82 int32 state = 11; //稿件状态
83 int32 access = 12;
84 int32 attribute = 13; //属性位配置
85 string tag = 14;
86 repeated string tags = 15;
87 int64 duration = 16; //总时长
88 int64 missionId = 17; //参与的活动id
89 int64 orderId = 18;
90 string redirectUrl = 19; //重定向url
91 int64 forward = 20;
92 Rights rights = 21;
93 Author author = 22; //UP主信息
94 Stat stat = 23; //状态数
95 string reportResult = 24;
96 string dynamic = 25; //动态内容
97 int64 firstCid = 26; //1P cid
98 Dimension dimension = 27; //1P 分辨率
99 repeated StaffInfo staffInfo = 28; //合作组成员列表
100 int64 seasonId = 29;
101 int64 attributeV2 = 30;
102 }
Added grpc_api/bilibili/app/playurl_v1.proto +213 -0
@@ -0,0 +1,213 @@
1 //APP端视频播放v1接口
2 syntax = "proto3";
3 package bilibili.app.playurl.v1;
4
5 message VideoInfo{
6 message stream{
7 message streamInfo{
8 message Limit{
9 string title=1;
10 string uri=2;
11 string msg=3;
12 }
13 uint32 quality=1;//清晰度
14 string format=2;//格式
15 string description=3;//格式描述
16 uint32 errCode=4;
17 Limit limit=5;
18 bool needVip=6;//需要vip
19 bool needLogin=7;//需要登录
20 bool intact=8;
21 bool noRexcode=9;
22 int64 attribute=10;
23 string newDescription=11;//新版格式描述
24 string displayDesc=12;//格式文字
25 string superscript=13;//新版格式描述备注
26 }
27 message DashVideo{
28 string baseUrl=1;//主线流
29 repeated string backupUrl=2;//备用流
30 uint32 bandwidth=3;//带宽
31 uint32 codecid=4;
32 string md5=5;//md5
33 uint64 size=6;//大小
34 uint32 audioId=7;
35 bool noRexcode=8;
36 }
37 message SegmentVideo{
38 message ResponseUrl{
39 uint32 order=1;
40 uint64 length=2;
41 uint64 size=3;
42 string url=4;
43 repeated string backupUrl=5;
44 string md5=6;
45 }
46 repeated ResponseUrl segment=1;
47 }
48 streamInfo info=1;//元数据
49 DashVideo dashvideo=2;//dash流
50 SegmentVideo segmentvideo=3;//flv流
51 }
52 message DashAudio{
53 uint32 id=1;
54 string baseUrl=2;//主线流
55 repeated string backupUrl=3;//备用流
56 uint32 bandwidth=4;//带宽
57 uint32 codecid=5;//
58 string md5=6;//md5
59 uint64 size=7;//大小
60 }
61 message DolbyItem{
62 int32 type=1;
63 DashAudio audio=2;
64 }
65 uint32 quality=1;//视频清晰度
66 string format=2;//视频格式
67 uint64 timelength=3;//视频时长
68 uint32 videoCodecid=4;//
69 repeated stream streamList=5;//视频流
70 repeated DashAudio audio=6;//伴音流
71 DolbyItem dolby=7;//杜比伴音流
72 }
73
74 message PlayAbilityConf{
75 bool backgroundPlayDisable=1;
76 bool flipDisable=2;
77 bool castDisable=3;
78 bool feedbackDisable=4;
79 bool subtitleDisable=5;
80 bool playbackRateDisable=6;
81 bool timeUpDisable=7;
82 bool playbackModeDisable=8;
83 bool scaleModeDisable=9;
84 bool likeDisable=10;
85 bool dislikeDisable=11;
86 bool coinDisable=12;
87 bool elecDisable=13;
88 bool shareDisable=14;
89 bool screenShotDisable=15;
90 bool lockScreenDisable=16;
91 bool recommendDisable=17;
92 bool playbackSpeedDisable=18;
93 bool definitionDisable=19;
94 bool selectionsDisable=20;
95 bool nextDisable=21;
96 bool editDmDisable=22;
97 bool smallWindowDisable=23;
98 bool shakeDisable=24;
99 bool outerDmDisable=25;
100 bool innerDmDisable=26;
101 bool freyaEnterDisable=27;
102 bool dolbyDisable=28;
103 }
104
105 message UpgradeLimit{
106 message Report{
107 string showEventId=1;
108 string clickEventId=2;
109 string extends=3;
110 }
111 message ButtonInfo{
112 message BadgeInfo{
113 string text=1;
114 string bgColor=2;
115 string bgColorNight=3;
116 }
117 string text=1;
118 string textColor=2;
119 string textColorNight=3;
120 string bgColor=4;
121 string bgColorNight=5;
122 string link=6;
123 string actionType=7;
124 BadgeInfo badgeInfo=8;
125 Report report=9;
126 }
127 int32 code =1;
128 string message =2;
129 string image =3;
130 ButtonInfo button=4;
131 }
132
133 message Chronos{
134 string md5=1;
135 string file=2;
136 }
137
138 message PlayArcConf{
139 message ArcConf{
140 bool isSupport=1;
141 }
142 ArcConf backgroundPlayConf=1;
143 ArcConf flipConf=2;
144 ArcConf castConf=3;
145 ArcConf feedbackConf=4;
146 ArcConf subtitleConf=5;
147 ArcConf playbackRateConf=6;
148 ArcConf timeUpConf=7;
149 ArcConf playbackModeConf=8;
150 ArcConf scaleModeConf=9;
151 ArcConf likeConf=10;
152 ArcConf dislikeConf=11;
153 ArcConf coinConf=12;
154 ArcConf elecConf=13;
155 ArcConf shareConf=14;
156 ArcConf screenShotConf=15;
157 ArcConf lockScreenConf=16;
158 ArcConf recommendConf=17;
159 ArcConf playbackSpeedConf=18;
160 ArcConf definitionConf=19;
161 ArcConf selectionsConf=20;
162 ArcConf nextConf=21;
163 ArcConf editDmConf=22;
164 ArcConf smallWindowConf=23;
165 ArcConf shakeConf=24;
166 ArcConf outerDmConf=25;
167 ArcConf innerDmConf=26;
168 ArcConf freyaEnterConf=27;
169 ArcConf dolbyConf=28;
170 }
171
172 message Event{
173 message Shake{
174 string file=1;
175 }
176 Shake shake=1;
177 }
178
179 //获取视频url
180 //https://app.bilibili.com/bilibili.app.playurl.v1.PlayURL/PlayView
181 //请求
182 message PlayURLReq{
183 int64 aid = 1; //avid
184 int64 cid = 2; //cid
185 int64 qn = 3; //清晰度
186 int32 fnver = 4; //流类型
187 int32 fnval = 5;
188 uint32 download = 6; //下载配置 0:播放 1:flv下载 2:dash下载
189 int32 forceHost = 7;
190 bool fourk = 8; //是否4K
191 string spmid = 9;
192 string fromSpmid = 10;
193 }
194 //回复
195 message PlayViewReply{
196 VideoInfo info = 1; //视频信息
197 PlayAbilityConf PlayConf = 2; //播放界面配置
198 UpgradeLimit upgradeLimit = 3;
199 Chronos chronos = 4;
200 PlayArcConf playArc = 5;
201 Event event = 6;
202 }
203
204 //获取播放界面配置
205 //https://app.bilibili.com/bilibili.app.playurl.v1.PlayURL/PlayConf
206 //请求
207 message PlayConfReq{
208
209 }
210 //回复
211 message PlayConfReply{
212 PlayAbilityConf playConf = 1;
213 }
Added grpc_api/bilibili/cheese_gateway_player_v1.proto +65 -0
@@ -0,0 +1,65 @@
1 //APP端课程播放v1接口
2 syntax = "proto3";
3 package bilibili.cheese.gateway.player.v1;
4
5 import public "bilibili/app/playurl_v1.proto";
6
7 message PlayAbilityConf{
8 bool backgroundPlayDisable=1;
9 bool flipDisable=2;
10 bool castDisable=3;
11 bool feedbackDisable=4;
12 bool subtitleDisable=5;
13 bool playbackRateDisable=6;
14 bool timeUpDisable=7;
15 bool playbackModeDisable=8;
16 bool scaleModeDisable=9;
17 bool likeDisable=10;
18 bool dislikeDisable=11;
19 bool coinDisable=12;
20 bool elecDisable=13;
21 bool shareDisable=14;
22 bool screenShotDisable=15;
23 bool lockScreenDisable=16;
24 bool recommendDisable=17;
25 bool playbackSpeedDisable=18;
26 bool definitionDisable=19;
27 bool selectionsDisable=20;
28 bool nextDisable=21;
29 bool editDmDisable=22;
30 bool smallWindowDisable=23;
31 bool shakeDisable=24;
32 bool outerDmDisable=25;
33 bool innerDmDisable=26;
34 bool freyaEnterDisable=27;
35 bool dolbyDisable=28;
36 }
37
38 //获取播放url
39 //https://app.bilibili.com/bilibili.cheese.gateway.player.v1.PlayURL/PlayView
40 //请求
41 message playViewReq{
42 enum CodeType{
43 NOCODE = 0;
44 CODE264 = 1;
45 CODE265 = 2;
46 }
47 int64 epid = 1; //目标剧集epid
48 int64 cid = 2; //目标视频cid
49 int64 qn = 3; //清晰度
50 int32 fnver = 4;
51 int32 fnval = 5; //流类型
52 uint32 download = 6; //下载配置 0:播放 1:flv下载 2:dash下载
53 int32 forceHost = 7;
54 bool fourk = 8; //是否4K
55 string spmid = 9;
56 string fromSpmid = 10;
57 int32 teenagersMode = 11;
58 CodeType codetype = 12; //编码类型
59 bool isPreview = 13;
60 }
61 //回复
62 message PlayViewReply{
63 bilibili.app.playurl.v1.VideoInfo info = 1; //视频信息
64 PlayAbilityConf PlayConf = 2; //播放界面配置
65 }
Added grpc_api/bilibili/main_community_reply_v1.proto +340 -0
@@ -0,0 +1,340 @@
1 //评论区v1接口
2 syntax = "proto3";
3 package bilibili.main.community.reply.v1;
4
5 import "google/protobuf/any.proto";
6
7 message CursorReq{
8 enum Mode{
9 DEFAULT = 0;
10 UNSPECIFIED = 1;
11 MAIN_LIST_TIME = 2;
12 MAIN_LIST_HOT = 3;
13 }
14 int64 next = 1;
15 int64 prev = 2;
16 Mode mode = 3; //排序模式
17 }
18
19 message CursorReply{
20 enum Mode{
21 DEFAULT = 0;
22 UNSPECIFIED = 1;
23 MAIN_LIST_TIME = 2;
24 MAIN_LIST_HOT = 3;
25 }
26 int64 next = 1;
27 int64 prev = 2;
28 bool isBegin = 3;
29 bool isEnd = 4;
30 Mode mode = 5;
31 }
32
33 enum SearchItemType{
34 DEFAULT_ITEM_TYPE = 0;
35 GOODS_VALUE = 1;
36 VIDEO_VALUE = 2;
37 ARTICLE_VALUE = 3;
38 }
39
40 message SearchItemCursorReq{
41 int64 next = 1;
42 SearchItemType itemType = 2;
43 }
44
45 message SearchItemCursorReply{
46 bool hasNext = 1;
47 int64 next = 2;
48 }
49
50 message Member{
51 int64 mid = 1; //UID
52 string name = 2; //昵称
53 string sex = 3; //性别
54 string face = 4; //头像url
55 int64 level = 5; //等级
56 int64 officialVerifyType = 6; //认证类型
57 int64 vipType = 7; //会员类型
58 int64 vipStatus = 8; //会员状态
59 int64 vipThemeType = 9;
60 string vipLabelPath = 10;
61 string garbPendantImage = 11; //头像框url
62 string garbCardImage = 12; //装扮卡url
63 string garbCardImageWithFocus = 13;
64 string garbCardJumpUrl = 14;//专属装扮页url
65 string garbCardNumber = 15;//专属装扮id
66 string garbCardFanColor = 16;//专属装扮id显示颜色
67 bool garbCardIsFan = 17;//是否为专属装扮卡
68 string fansMedalName = 18;
69 int64 fansMedalLevel = 19;
70 int64 fansMedalColor = 20;
71 }
72
73 message Content{
74 message Emote{
75 int64 size = 1;//表情大小 1:小 2:大
76 string url = 2;//标签url
77 }
78 message Topic{
79 string link = 1;
80 int64 id = 2;
81 }
82 message Url{
83 string title = 1; //标题
84 int64 state = 2;
85 string prefixIcon = 3; //图标url
86 string appUrlSchema = 4;
87 string appName = 5;
88 string appPackageName = 6;
89 string clickReport = 7;
90 }
91 message Vote{
92 int64 id = 1;
93 string title = 2;
94 int64 count = 3;
95 }
96 string message = 1; //评论正文
97 map<string,Member> menber = 2; //at到的用户信息
98 map<string,Emote> emote = 3; //表情转义
99 map<string,Topic> topic = 4; //话题转义
100 map<string,Url> url = 5; //扩展应用转义
101 Vote vote = 6;
102 }
103
104 message ReplyControl{
105 int64 action = 1; //操作标志 0:无 1:已点赞 2:已点踩
106 bool upLike = 2; //是否UP觉得很赞
107 bool upReply = 3; //是否存在UP回复
108 bool showFollowBtn = 4; //是否显示关注按钮
109 bool isAssist = 5;
110 string labelText = 6;
111 bool following = 7; //是否关注
112 bool followed = 8; //是否粉丝
113 bool blocked = 9;
114 bool hasFoldedReply = 10;
115 bool isFoldedReply = 11;
116 bool isUpTop = 12; //是否UP置顶
117 bool isAdminTop = 13; //是否管理置顶
118 bool isVoteTop = 14; //是否投票评论
119 int64 maxLine = 15; //最大收起行数
120 bool invisible = 16;
121 }
122
123 message ReplyInfo{
124 repeated ReplyInfo replies = 1; //二级评论
125 int64 id = 2; //rpid
126 int64 oid = 3; //对象id
127 int64 type = 4; //评论区类型id
128 int64 mid = 5; //发布者UID
129 int64 root = 6; //根评论rpid
130 int64 parent = 7; //父评论rpid
131 int64 dialog = 8; //对话评论rpid
132 int64 like = 9; //点赞数
133 int64 ctime = 10; //发布时间
134 int64 count = 11; //回复数
135 Content content = 12; //评论主体信息
136 Member member = 13; //评论发布者信息
137 ReplyControl replyControl = 14; //评论显示控制项
138 }
139
140 message SubjectControl{
141 int64 upMid = 1; //UP主UID
142 bool isAssist = 2;
143 bool readOnly = 3;
144 bool hasVoteAccess = 4;
145 bool hasLotteryAccess = 5;
146 bool hasFoldedReply = 6;
147 string bgText = 7; //空评论背景文字
148 bool upBlocked = 8;
149 bool hasActivityAccess = 9;
150 bool showTitle = 10;
151 bool showUpAction = 11;
152 int64 switcherType = 12;
153 bool inputDisable = 13;
154 string rootText = 14; //输入框背景文字
155 string childText = 15;
156 int64 count = 16; //评论总数
157 string title = 17; //评论区标题
158 }
159
160 message Notice{
161 int64 id = 1;
162 string content = 2;
163 string link = 3;
164 }
165
166 message Lottery{
167 int64 lotteryId = 1;
168 int64 lotteryStatus = 2;
169 int64 lotteryMid = 3;
170 int64 lotteryTime = 4;
171 int64 oid = 5;
172 int64 type = 6;
173 int64 ctime = 7;
174 Content content = 8;
175 Member member = 9;
176 ReplyControl replyControl = 10;
177 }
178
179 message Activity{
180 int64 activityId = 1;
181 int64 activityState = 2;
182 string activityPlaceholder = 3;
183 }
184
185 message UpSelection{
186 int64 pendingCount = 1;
187 int64 ignoreCount = 2;
188 }
189
190 message CM{
191 google.protobuf.Any sourceContent = 1;
192 }
193
194 message SearchItem{
195 message ArticleSearchItem{
196 string title = 1;
197 string upNickname = 2;
198 repeated string covers = 3;
199 }
200 message GoodsSearchItem{
201 int64 id = 1;
202 string name = 2;
203 string price = 3;
204 string income = 4;
205 string img = 5;
206 string label = 6;
207 }
208 message VideoSearchItem{
209 enum VideoItemCase{
210 VIDEOITEM_NOT_SET = 0;
211 UGC = 2;
212 PGC = 3;
213 }
214 message UGCVideoSearchItem{
215 string title = 1;
216 string upNickname = 2;
217 int64 duration = 3;
218 string cover = 4;
219 }
220 message PGCVideoSearchItem{
221 string title = 1;
222 string category = 2;
223 string cover = 3;
224 }
225 VideoItemCase type = 1;
226 UGCVideoSearchItem UGCVideo = 2;
227 PGCVideoSearchItem PGCVideo = 3;
228 }
229 enum ItemCase{
230 ITEM_NOT_SET = 0;
231 GOODS = 2;
232 VIDEO = 3;
233 ARTICLE = 4;
234 }
235 string url = 1;
236 GoodsSearchItem goods = 2;
237 VideoSearchItem video = 3;
238 ArticleSearchItem article = 4;
239 }
240
241 message SearchItemReplyExtraInfo{
242 string eventId = 1;
243 }
244
245 //评论列表
246 //https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/MainList
247 //请求
248 message MainListReq{
249 int64 oid = 1; //目标评论区id
250 int64 type = 2; //评论区类型
251 CursorReq cursor = 3; //页面选择
252 string extra = 4;
253 string adExtra = 5;
254 int64 rpid = 6;
255 }
256 //回复
257 message MainListReply{
258 CursorReply cursor = 1; //页面信息
259 repeated ReplyInfo replies = 2; //评论条目
260 SubjectControl subjectControl = 3; //评论区显示控制
261 ReplyInfo upTop = 4; //UP置顶评论
262 ReplyInfo adminTop = 5; //管理置顶评论
263 ReplyInfo voteTop = 6; //投票评论
264 Notice notice = 7;
265 Lottery lottery = 8; //抽奖评论
266 Activity activity = 9;
267 UpSelection upSelection = 10;
268 CM cm = 11;
269 }
270
271 //二级评论明细
272 //https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/DetailList
273 //请求
274 message DetailListReq{
275 enum DetailListScene{
276 REPLY = 0; //评论区展开
277 MSG_FEED = 1; //回复消息推送
278 }
279 int64 oid = 1; //目标评论区id
280 int64 type = 2; //评论区类型
281 int64 root = 3; //根评论rpid
282 int64 rpid = 4; //目标评论rpid
283 CursorReq cursor = 5; //页面选择
284 DetailListScene scene = 6; //来源标识
285 }
286 //回复
287 message DetailListReply{
288 CursorReply cursor = 1; //页面信息
289 SubjectControl subjectControl = 2; //评论区显示控制
290 ReplyInfo root = 3; //根评论信息(带二级评论)
291 Activity activity = 4;
292 }
293
294 //对话评论回复树
295 //https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/DialogList
296 //请求
297 message DialogListReq{
298 int64 oid = 1; //目标评论区id
299 int64 type = 2; //评论区类型
300 int64 root = 3; //根评论rpid
301 int64 rpid = 4; //目标评论rpid
302 CursorReq cursor = 5; //页面选择
303 }
304 //回复
305 message DialogListReply{
306 CursorReply cursor = 1; //页面信息
307 SubjectControl subjectControl = 2; //评论区显示控制
308 repeated ReplyInfo replies = 3; //评论树列表
309 Activity activity = 4;
310 }
311
312 //搜索提示信息?
313 //https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/SearchItemPreHook
314 //请求
315 message SearchItemPreHookReq{
316 int64 oid = 1; //目标评论区id
317 int64 type = 2; //评论区类型
318 }
319 //回复
320 message SearchItemPreHookReply{
321 string placeholderText = 1;
322 string backgroundText = 2;
323 repeated SearchItemType orderedType = 3;
324 }
325
326 //搜索评论区插入项目
327 //https://app.bilibili.com/bilibili.main.community.reply.v1.Reply/SearchItem
328 //请求
329 message SearchItemReq{
330 SearchItemCursorReq cursor = 1; //页面选择
331 int64 oid = 2; //目标评论区id
332 int64 type = 3; //评论区类型
333 string keyword = 4; //搜索关键词
334 }
335 //回复
336 message SearchItemReply{
337 SearchItemCursorReply cursor = 1;
338 repeated SearchItem items = 2;
339 SearchItemReplyExtraInfo extra = 3;
340 }
Added grpc_api/bilibili/metadata/device.proto +20 -0
@@ -0,0 +1,20 @@
1 syntax = "proto3";
2 package bilibili.metadata.device;
3
4 //环境参数1
5 //x-bili-device-bin
6 message Device{
7 int32 appId = 1;
8 int32 build = 2;
9 string buvid = 3;
10 string mobiApp = 4;
11 string platform = 5;
12 string device = 6;
13 string channel = 7;
14 string brand = 8;
15 string model = 9;
16 string osver = 10;
17 string fpLocal = 11;
18 string fpRemote = 12;
19 string versionName = 13;
20 }
Added grpc_api/bilibili/metadata/locale.proto +10 -0
@@ -0,0 +1,10 @@
1 syntax = "proto3";
2 package bilibili.metadata.locale;
3
4 //区域标识
5 //x-bili-locale-bin
6 message LocaleIds{
7 string language = 1;
8 string script = 2;
9 string region = 3;
10 }
Added grpc_api/bilibili/metadata/metadata.proto +23 -0
@@ -0,0 +1,23 @@
1 syntax = "proto3";
2 package bilibili.metadata;
3
4 //环境参数2
5 //x-bili-metadata-bin
6 message Metadata{
7 string accessKey = 1;
8 string mobiApp = 2;
9 string device = 3;
10 int32 build = 4;
11 string channel = 5;
12 string buvid = 6;
13 string platform = 7;
14 }
15
16 import "google/protobuf/any.proto";
17 //接口回复报错信息
18 //grpc-status-details-bin
19 message Status{
20 int32 code = 1; //错误码
21 string message = 2; //错误信息
22 repeated google.protobuf.Any details = 3; //套娃专用
23 }
Added grpc_api/bilibili/metadata/network.proto +25 -0
@@ -0,0 +1,25 @@
1 syntax = "proto3";
2 package bilibili.metadata.network;
3
4 enum Type{
5 NT_UNKNOWN = 0;
6 WIFI = 1; //wifi
7 CELLULAR = 2; //蜂窝网络
8 OFFLINE = 3; //离线
9 ETHERNET = 5; //以太网
10 OTHERNET = 4; //其他
11 }
12
13 /*
14 enum Tf{
15
16 }*/
17
18 //网络类型标识
19 //x-bili-network-bin
20 message Network{
21 Type type = 1; //网络类型
22 //Tf tf = 2;
23 int32 tf = 2;
24 string oid = 3;
25 }
Added grpc_api/bilibili/metadata/restriction.proto +8 -0
@@ -0,0 +1,8 @@
1 syntax = "proto3";
2 package bilibili.metadata.restriction;
3
4 enum ModeType{
5 NORMAL = 0;
6 TEENAGERS = 1;
7 LESSONS = 2;
8 }
Added grpc_api/bilibili/pgc/gateway_player_v2.proto +245 -0
Added grpc_api/bilibili/rpc.proto +12 -0
@@ -0,0 +1,12 @@
1 syntax = "proto3";
2 package bilibili.rpc;
3
4 import "google/protobuf/any.proto";
5
6 //接口回复报错信息
7 //grpc-status-details-bin
8 message Status{
9 int32 code = 1; //错误码
10 string message = 2; //错误信息
11 repeated google.protobuf.Any details = 3; //套娃专用
12 }
Added grpc_api/comp_proto.bat +8 -0
@@ -0,0 +1,8 @@
1 @ echo off
2 rem 递归编译proto
3 set lang="python"
4 set patch=%CD%
5 for /r %patch% %%a in (*.proto) do (
6 protoc.exe -I %patch% --%lang%_out=. %%~fa
7 echo comp %%~fa ok!
8 )
Added grpc_api/readme.md +27 -0
@@ -0,0 +1,27 @@
1 # grpc接口定义(protobuf结构体)
2
3 - `comp_proto.bat`---win递归批量编译脚本
4
5 注:
6
7 1. proto结构体文件按照包名分类,同级放在同一目录中
8 2. 暂时无说明文档,稍后添加
9 3. 以下文件全部来自apk的逆向工程,如有疏漏请包涵
10
11 ## grpc头部
12
13 - [bilibili.metadata.locale](bilibili/metadata/locale.proto):区域信息
14 - [bilibili.metadata.network](bilibili/metadata/network.proto):网络信息
15 - [bilibili.metadata](bilibili/metadata/metadata.proto):环境参数
16 - [bilibili.metadata.restriction](bilibili/metadata/restriction.proto):限制值
17 - [bilibili.metadata.device](bilibili/metadata/device.proto):设备信息
18 - [bilibili.rpc](bilibili/rpc.proto):响应错误信息
19
20 ## 接口请求定义
21
22 - [blibili.app.archive.v1](bilibili/app/archive_v1.proto):稿件信息v1模块
23 - [blibili.app.playurl.v1](bilibili/app/playurl_v1.proto):APP端视频播放v1接口
24 - [blibili.app.view.v1](bilibili/app/view_v1.proto):视频页v1接口
25 - [bilibili.pgc.gateway.player.v2](bilibili/pgc/gateway_player_v2.proto):APP端PGC播放v2接口
26 - [bilibili.cheese.gateway.player.v1](bilibili/cheese_gateway_player_v1.proto):APP端课程播放v1接口
27 - [bilibili.main.community.reply.v1](bilibili/main_community_reply_v1.proto):评论区v1接口