Reputation: 2036
I was able to successfully upload a sample video to youtube using the Google API NodeJS Client library. But unfortunately, when I head over to Youtube, I noticed the Video is not visible to the public, it was only visible to me. How can I make the video visible to everyone in the code..
Below is the code I used to upload the video
let res = await youtube.videos.insert({
part: "id,snippet,status",
notifySubscribers: true,
requestBody: {
id: channelId,
snippet: {
title: title,
description: description,
},
status: {
privacyStatus: "public",
},
},
media: {
body: fs.createReadStream(filePath),
},
});
console.log(`Youtube Upload Response:`);
console.log(res.data);
Any ideas would be really appreciated. Thank you
Upvotes: 1
Views: 416
Reputation: 116898
As per the documentation videos insert
All videos uploaded via the videos.insert endpoint from unverified API projects created after 28 July 2020 will be restricted to private viewing mode. To lift this restriction, each API project must undergo an audit to verify compliance with the Terms of Service. Please see the API Revision History for more details.
Go to google cloud console and submit your application for verification once it has been though the verification process you will then be able to upload videos that are public.
Upvotes: 1