1+ // B站开放接口 - 视频稿件投递 bilibili-webapp
2+
3+ syntax = "proto3" ;
4+ package member.bilibili.com ;
5+ import "google/api/annotations.proto" ;
6+
7+ option go_package = "github.com/dev-openapi/bilibili-webapp" ;
8+
9+ service UploadService {
10+ // 文件上传预处理 https://openhome.bilibili.com/doc/4/0c532c6a-e6fb-0aff-8021-905ae2409095
11+ rpc InitPart (InitPartReq ) returns (InitPartRes ) {
12+ option (google.api.http ) = {
13+ post : "/arcopen/fn/archive/video/init" ,
14+ body : "body" ,
15+ };
16+ }
17+ // 文件分片上传 域名用 https://openupos.bilivideo.com https://openhome.bilibili.com/doc/4/733a520a-c50f-7bb4-17cb-35338ba20500
18+ rpc UploadPart (UploadPartReq ) returns (UploadPartRes ) {
19+ option (google.api.http ) = {
20+ post : "/video/v2/part/upload" ,
21+ };
22+ }
23+ // 分片合并 https://openhome.bilibili.com/doc/4/0828e499-38d8-9e58-2a70-a7eaebf9dd64
24+ rpc CompletePart (CompletePartReq ) returns (CompletePartRes ) {
25+ option (google.api.http ) = {
26+ post : "/arcopen/fn/archive/video/complete" ,
27+ };
28+ }
29+ // 封面上传 https://openhome.bilibili.com/doc/4/8243399e-50e3-4058-7f01-1ebe4c632cf8
30+ rpc UploadCover (UploadCoverReq ) returns (UploadCoverRes ) {
31+ option (google.api.http ) = {
32+ post : "/arcopen/fn/archive/cover/upload" ,
33+ body : "body,multi" ,
34+ };
35+ }
36+ // 单次上传 域名用 https://openupos.bilivideo.com https://openhome.bilibili.com/doc/4/f22a0eee-c92d-0f1d-f69c-be170cf533c7
37+ rpc Upload (UploadReq ) returns (UploadRes ) {
38+ option (google.api.http ) = {
39+ post : "/video/v2/upload" ,
40+ body : "body" ,
41+ };
42+ }
43+ // 上传图片 https://openhome.bilibili.com/doc/4/0eaa4d3e-c4c0-f874-6f3c-e083aa939a1b
44+ rpc UploadImage (UploadImageReq ) returns (UploadImageRes ) {
45+ option (google.api.http ) = {
46+ post : "/arcopen/fn/article/upload/image" ,
47+ body : "body,multi" ,
48+ };
49+ }
50+ }
51+
52+ message InitPartReq {
53+ string client_id = 1 ;
54+ string access_token = 2 ;
55+ message Body {
56+ string name = 1 ;
57+ string utype = 2 ;
58+ }
59+ Body body = 10 ;
60+ }
61+
62+ message Uptoken {
63+ string upload_token = 1 ;
64+ }
65+
66+ message InitPartRes {
67+ int32 code = 1 ;
68+ string message = 2 ;
69+ int32 ttl = 3 ;
70+ Uptoken data = 10 ;
71+ }
72+
73+ message UploadPartReq {
74+ string upload_token = 1 ;
75+ int64 part_number = 2 ;
76+ }
77+ message UploadPartRes {
78+ int32 code = 1 ;
79+ string message = 2 ;
80+ int32 ttl = 3 ;
81+ }
82+
83+ message CompletePartReq {
84+ string upload_token = 1 ;
85+ }
86+
87+ message CompletePartRes {
88+ int32 code = 1 ;
89+ string message = 2 ;
90+ int32 ttl = 3 ;
91+ }
92+
93+ message UploadCoverReq {
94+ string client_id = 1 ;
95+ string access_token = 2 ;
96+ message Body {
97+ bytes file = 1 ;
98+ }
99+ Body body = 10 ;
100+ }
101+ message UploadCoverRes {
102+ int32 code = 1 ;
103+ string message = 2 ;
104+ int32 ttl = 3 ;
105+ message Data {
106+ string url = 1 ;
107+ }
108+ Data data = 10 ;
109+ }
110+
111+ message UploadReq {
112+ string upload_token = 1 ;
113+ bytes body = 2 ;
114+ }
115+
116+ message UploadRes {
117+ int32 code = 1 ;
118+ string message = 2 ;
119+ int32 ttl = 3 ;
120+ }
121+
122+ message UploadImageReq {
123+ string client_id = 1 ;
124+ string access_token = 2 ;
125+ message Body {
126+ bytes file = 1 ;
127+ bool watermark = 2 ;
128+ }
129+ Body body = 10 ;
130+ }
131+
132+ message UploadImageRes {
133+ int32 code = 1 ;
134+ string message = 2 ;
135+ int32 ttl = 3 ;
136+ message Data {
137+ string url = 1 ;
138+ int64 size = 2 ;
139+ }
140+ Data data = 10 ;
141+ }
0 commit comments