我想通过他们的API在YouTube上上传视频这是我的代码:
Youtube.videos.insert({
resource: {
// Video title and description
snippet: {
title: "Testing YoutTube API NodeJS module",
description: "Test video upload via YouTube API",
tags: ["music"],
defaultLanguage: "en"
},
// I don't want to spam my subscribers
status: {
privacyStatus: "private"
}
}
// This is for the callback function
, part: "snippet,status"
// Create the readable stream to upload the video
, media: {
body: fs.createReadStream(video_path)
}
}, (err, data) => {
if (err) {
console.log(err);
}
else {
console.log("Done.");
}
});
您可以在此处上传视频时找到可以设置的所有字段的描述。
尚无API中视频资源的产品放置属性。如果您检查视频属性,就不会提及。