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