I was trying to upload videos to youtube using the firebase cloud function.
What I need is when a user uploads a video to firebase cloud storage, functions.storage.objec
You can also use a resumable video upload following a series of steps:
range header (undocumented on the JSON API, but I already reported it), and uploads the chunk to YoutubeI have not tried, but this might even allow parallel uploads to Youtube from different functions uploading different chunks (which would greatly improve performance, although the docs suggest that the chunks need to be uploaded in order). You can download an arbitrary chunk from a GCS object, so the GCS side of things are not a problem for parallelization.
If parallel uploads are not allowed, you can just insert a new pubsub message when a functions finishes uploading it's chunk with the last byte uploaded, so the execution of functions is ordered (while it allows for parallel uploads of different videos).
This is a little more involved, but allows you to upload arbitrary-sized videos (up to the current 128 GB limit on Youtube) from small functions.
Take care to handle failures properly (maybe re-inserting the chunk into the pubsub topic).