2

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 ?

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.