使用谷歌的节点api库,我似乎无法上传缩略图。我已经广泛使用它来上传和列出视频而没有任何问题。
const blogInput = "We went to target last night, also to publix";
const storeNames = ["kroger", "lums", "marlows", "eats", "burger king",
"home", "wendys", "publix", "donut circus", "jewelry store",
"target"];
// filter out any store names that aren't included in blogInput
var matches = storeNames.filter(store => blogInput.includes(store));
这导致let req = Youtube.thumbnails.set(
{
videoId: video_id,
media: {
mimeType: "image/jpeg",
body: "test.jpg"
}
},
(err, thumbResponse) => {
if (err) {
console.log(err);
process.exit(1);
}
console.log("thumbnail uploaded");
console.log(thumbResponse);
}
);
使用流会导致Error: The provided image content is invalid.
错误。
我使用的图片是一张典型的1280x720图片,我通过手动上传到youtube上进行了测试。 Error: write after end
设置为我拥有的视频