Youtube API thumbnail loading not working

Using google node api library, I can't seem to get the download thumbnails to work. I used it to upload and post videos without any problem.

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);
  }
);

      

The result is Error: The provided image content is invalid.

Using a stream instead results in an error Error: write after end

.

The image I am using is a typical 1280x720 image which I verified by manually uploading to youtube. video_id

set for a video that belongs to me

+3


source to share





All Articles