Certain YouTube links don't work

const response = await genAI.models.generateContent({
  model: "gemini-2.5-pro-preview-06-05",
  contents: [
    {
      role: "user",
      parts: [
        {
          fileData: {
            fileUri: "https://www.youtube.com/watch?v=1yBHTJx6-Oc",
          },
        },
      ],
    },
    {
      role: "user",
      parts: [{ text: "Summarize the video in 10 words." }],
    },
  ],
});

This is my error message

ClientError: got status: 400 Bad Request. {"error":{"code":400,"message":"* GenerateContentRequest.contents[0].parts: contents.parts must not be empty.\n","status":"INVALID_ARGUMENT"}}

Other urls work fine, why doesn’t this video work?

At first I thought ‘-’ was the problem, so I tried adding other videos with ‘-’ in the videoId, but there was no problem. Are there other people who are having the same problem as me?

Hi @_Garden, Could please confirm the youtube video link you has passed is a public video or not, because you can only upload public videos (not private or unlisted videos). Thank You

This video is public and also can embed on web…