I've been trying to figure this out for hours now. Consulting the official documentation It says I need to make a post request to https://www.googleapis.com/upload/youtube/v3/videos
with a content type header set to video/*
or application/octet-stream
(I've used the latter). Turns out if I just post a buffer of a video file to that url it'll work. But the documentation also says I can specify a whole bunch of options about the video (title, description, tags, etc.) However, it says to attach that information to the request body! I'm confused on how I'm supposed to send both the video bytes and the options in the same request. Maybe it's not supposed to be the same request, but they don't mention anything about using multiple.
Uploading videos using Youtube API is done using a protocol that Google calls "Resumable Uploads Protocol". Google uses this protocol across their APIs (i.e. Drive, Youtube etc.) and is recommended in the following scenarios
The full details of how to use "Resumable Uploads Protocol" with the Youtube API can be found at https://developers.google.com/youtube/v3/guides/using_resumable_upload_protocol.
The following is a simplified set of steps:
POST
request to the insert
API endpoint.Location
header of the above request.