Send chunk for the resumable replacement of a video
PeerTube >= 6.0 Uses a resumable protocol to continue, pause or resume the replacement of a video
Body
Parameters
idid | UUIDv4 | shortUUIDrequiredpathThe object id, uuid or short uuid
upload_ idstringrequiredqueryCreated session id to proceed with. If you didn't send chunks in the last hour, it is not valid anymore and you need to initialize a new upload.
Content-RangestringrequiredheaderSpecifies the bytes in the file that the request is uploading.
For example, a value of bytes 0-262143/1000000 shows that the request is sending the first
262144 bytes (256 x 1024) in a 2,469,036 byte file.
When the server config client.videos.resumableUpload.minChunkSize (video uploads) or
import.users.resumableUpload.minChunkSize (user archive imports) is not 0,
every chunk except the last one must be at least that big. It must also be at least 1/10,000 of the file size
(the maximum number of object storage multipart upload parts).
Content-LengthnumberrequiredheaderSize of the chunk that the request is sending.
Remember that larger chunks are more efficient. PeerTube's web client uses chunks varying from 1048576 bytes (~1MB) and increases or reduces size depending on connection health.
Response
last chunk received: successful operation
resume incomplete
chunk is smaller than client.videos.resumableUpload.minChunkSize of the server config or 1/10,000 of the file size (and is not the last one)
video didn't pass file replacement filter
replace upload not found
chunk doesn't match range
video unreadable
too many concurrent requests
upload is already being processed
Authorization
OAuth2oauth2Authenticating via OAuth requires the following steps:
- Have an activated account
- Generate an access token for that account at
/api/v1/users/token. - Make requests with the Authorization: Bearer <token> header
- Profit, depending on the role assigned to the account
Note that the access token is valid for 1 day and is given along with a refresh token valid for 2 weeks.