Using the NPM package 'googleapis' to upload a video to Youtube, I have the following error:
Error: Request body larger than maxBodyLength limit
How can I raise the limit manually to avoid this error ?
Simply add the following code before starting the upload to Youtube:
const followRedirects = require('follow-redirects');
followRedirects.maxRedirects = 10;
followRedirects.maxBodyLength = 500 * 1024 * 1024 * 1024; // 500 GB
It imports the package 'followRedirects' and set the limit to 500GB.