Youtube API thumbnail upload isn't working

Viewed 865

Using google's node api library, I can't seem to get thumbnail uploading to work. I've used it extensively for uploading and listing videos without any issues.

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

This results in Error: The provided image content is invalid.

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

The image I'm using is a typical 1280x720 image that I've tested by manually uploading to youtube fine. video_id is set to a video i own

0 Answers
Related