-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
276 lines (263 loc) · 10.3 KB
/
Copy pathopenapi.yaml
File metadata and controls
276 lines (263 loc) · 10.3 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
openapi: 3.0.3
info:
title: vodstack API
version: "1.0.0"
description: >
Self-hosted VOD streaming API (a Bunny Stream alternative). The library API is
authenticated with a per-library API key sent as `AccessKey: <key>` or
`Authorization: Bearer <key>`. Playback URLs are HMAC signed-URL tokens served
from the edge; an embeddable iframe player and a public viewer-analytics beacon
are also exposed.
servers:
- url: http://localhost:8080
description: Local dev
components:
securitySchemes:
ApiKey:
type: apiKey
in: header
name: AccessKey
Bearer:
type: http
scheme: bearer
schemas:
Video:
type: object
properties:
videoId: { type: string, format: uuid }
libraryId: { type: string }
title: { type: string }
description: { type: string, description: "LLM-generated summary/description" }
tags:
type: array
items: { type: string }
description: "LLM-generated content tags"
status:
type: integer
description: "0 created, 1 uploaded, 2 processing, 3 transcoding, 4 finished, 5 failed"
length: { type: integer, description: seconds }
width: { type: integer }
height: { type: integer }
storageSize: { type: integer, format: int64 }
availableResolutions: { type: string, example: "360p,720p" }
encodeProgress: { type: integer }
errorMessage: { type: string }
PlayResponse:
type: object
properties:
videoId: { type: string }
isReady: { type: boolean }
status: { type: integer }
length: { type: integer }
hlsUrl: { type: string, description: "Signed master.m3u8 URL (avc1 plus av01/hvc1/vp09 when extra codecs are built)" }
posterUrl: { type: string }
thumbnailsUrl: { type: string }
chaptersUrl: { type: string }
mp4Url: { type: string, description: "Signed progressive MP4 (<=1080p) fallback URL, when MP4 fallback is enabled" }
downloadUrl: { type: string, description: "Signed original-file download URL, when AllowDownload is enabled" }
earlyPlay: { type: boolean, description: "True when the original is playable before encoding finishes (Early-Play)" }
earlyPlayUrl: { type: string, description: "Signed original URL for Early-Play (present only while not yet ready)" }
captions:
type: array
items:
type: object
properties:
lang: { type: string }
label: { type: string }
url: { type: string }
SearchHit:
type: object
properties:
videoId: { type: string }
title: { type: string }
lang: { type: string }
startSec: { type: number, description: "Seek target (seconds) for this transcript moment" }
endSec: { type: number }
snippet: { type: string }
score: { type: number, description: "Fused (RRF) relevance score" }
SearchResponse:
type: object
properties:
enabled: { type: boolean, description: "False when in-video search is disabled for the library" }
results:
type: array
items: { $ref: "#/components/schemas/SearchHit" }
Error:
type: object
properties:
error: { type: string }
security:
- ApiKey: []
- Bearer: []
paths:
/api/library/{libraryId}/videos:
post:
summary: Create a video record
parameters:
- { name: libraryId, in: path, required: true, schema: { type: string } }
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [title]
properties:
title: { type: string }
collectionId: { type: string }
responses:
"201":
description: Created
content:
application/json:
schema:
type: object
properties:
videoId: { type: string }
libraryId: { type: string }
status: { type: integer }
"401": { description: Unauthorized, content: { application/json: { schema: { $ref: "#/components/schemas/Error" } } } }
"429": { description: Rate limited }
/api/library/{libraryId}/videos/{videoId}/upload-url:
post:
summary: Get a presigned PUT URL for the raw source
parameters:
- { name: libraryId, in: path, required: true, schema: { type: string } }
- { name: videoId, in: path, required: true, schema: { type: string } }
responses:
"200":
description: Presigned URL
content:
application/json:
schema:
type: object
properties:
url: { type: string }
method: { type: string, example: PUT }
object: { type: string }
expires: { type: integer }
/api/library/{libraryId}/videos/{videoId}/complete:
post:
summary: Mark the upload complete and enqueue transcoding
parameters:
- { name: libraryId, in: path, required: true, schema: { type: string } }
- { name: videoId, in: path, required: true, schema: { type: string } }
responses:
"202": { description: Transcode enqueued }
/api/library/{libraryId}/videos/{videoId}/fetch:
post:
summary: Ingest from a source URL (migrate an existing video)
parameters:
- { name: libraryId, in: path, required: true, schema: { type: string } }
- { name: videoId, in: path, required: true, schema: { type: string } }
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [url]
properties:
url: { type: string, format: uri }
responses:
"202": { description: Fetch + transcode enqueued }
/api/library/{libraryId}/videos/{videoId}:
get:
summary: Get video metadata
parameters:
- { name: libraryId, in: path, required: true, schema: { type: string } }
- { name: videoId, in: path, required: true, schema: { type: string } }
responses:
"200":
description: Video
content: { application/json: { schema: { $ref: "#/components/schemas/Video" } } }
"404": { description: Not found }
delete:
summary: Soft-delete a video (recoverable trash)
parameters:
- { name: libraryId, in: path, required: true, schema: { type: string } }
- { name: videoId, in: path, required: true, schema: { type: string } }
responses:
"204": { description: Deleted }
/api/library/{libraryId}/videos/{videoId}/play:
get:
summary: Mint a signed playback payload
parameters:
- { name: libraryId, in: path, required: true, schema: { type: string } }
- { name: videoId, in: path, required: true, schema: { type: string } }
responses:
"200":
description: Signed play payload
content: { application/json: { schema: { $ref: "#/components/schemas/PlayResponse" } } }
"403": { description: Access expired }
/api/library/{libraryId}/videos/{videoId}/download:
get:
summary: Signed download URL for the original file (when AllowDownload is enabled)
parameters:
- { name: libraryId, in: path, required: true, schema: { type: string } }
- { name: videoId, in: path, required: true, schema: { type: string } }
responses:
"200":
description: Download payload (downloadUrl) or an error field when disabled/unavailable
content:
application/json:
schema:
type: object
properties:
videoId: { type: string }
downloadUrl: { type: string }
error: { type: string }
/api/library/{libraryId}/search:
get:
summary: Hybrid in-video search over transcripts (semantic + lexical)
parameters:
- { name: libraryId, in: path, required: true, schema: { type: string } }
- { name: q, in: query, required: true, schema: { type: string }, description: "Search query" }
- { name: videoId, in: query, required: false, schema: { type: string }, description: "Restrict to one video" }
responses:
"200":
description: Matching transcript moments
content: { application/json: { schema: { $ref: "#/components/schemas/SearchResponse" } } }
"401": { description: Unauthorized }
/embed/{libraryId}/{videoId}:
get:
summary: Embeddable iframe player page (HTML, no auth)
security: []
parameters:
- { name: libraryId, in: path, required: true, schema: { type: string } }
- { name: videoId, in: path, required: true, schema: { type: string } }
responses:
"200": { description: HTML player, content: { text/html: {} } }
/beacon:
post:
summary: Viewer QoE beacon (public, no auth)
security: []
requestBody:
content:
application/json:
schema:
type: object
required: [videoId, libraryId, sessionId, event]
properties:
videoId: { type: string }
libraryId: { type: string }
sessionId: { type: string }
event: { type: string, enum: [start, playing, rebuffer, error, progress, ended] }
position: { type: number }
value: { type: number }
bitrate: { type: integer }
resolution: { type: string }
responses:
"204": { description: Recorded }
/keys/{libraryId}/{videoId}:
get:
summary: AES-128 content key (gated by the playback token)
security: []
parameters:
- { name: libraryId, in: path, required: true, schema: { type: string } }
- { name: videoId, in: path, required: true, schema: { type: string } }
- { name: exp, in: query, required: true, schema: { type: integer } }
- { name: token, in: query, required: true, schema: { type: string } }
responses:
"200": { description: 16-byte AES key, content: { application/octet-stream: {} } }
"403": { description: Missing/invalid token }