I am developing a bot with javascript, I am using the following code:
const service = google.youtube('v3'); service.videos.insert( { auth, part: 'id,snippet', resource: { snippet: { title: 'My title', description: 'This is a test', }, status: { privacyStatus: 'private', }, }, media: { body: fs.createReadStream(videoUrl), }, }, (err, res) => { if (err) { reject(err); } } );but I am getting this error:
GaxiosError: 'status'{ response: { config: { url: 'https://youtube.googleapis.com/upload/youtube/v3/videos?part=id%2Csnippet&uploadType=multipart', method: 'POST', userAgentDirectives: [ { product: 'google-api-nodejs-client', version: '5.1.0', comment: 'gzip' } ], ...... headers: { my headers } ...... code: 400, errors: [ { message: "'status'", domain: 'youtube.part', reason: 'unexpectedPart', location: 'part', locationType: 'parameter' } ]I believe that the problem is with the statius, as soon as I remove it, it works. Please help me, how can I upload the video while still leaving it in public?