Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Adding YouTube video to playlist via google script results in unhelpful error message [duplicate]

$
0
0

I want to add some YouTube videos to my own playlist via Google Apps Script.

I added the necessary resources, and I am able to load videos from the playlist.

The code should be relative simple:

function add_video_to_playlist() {  const playlist_id = "MY_PLAYLIST_ID";  const video_id = "dQw4w9WgXcQ";  const video_snippet = {    playlistId: playlist_id,    resourceId: {      kind: "youtube#video",      videoId: video_id    }  }  YouTube.PlaylistItems.insert(video_snippet, "snippet");  console.log("Video added successfuly!");}

and was inspired by following Stack Overflow answer:https://stackoverflow.com/a/63424661/13278191

But I get a weird error message, whenever I run my function:

GoogleJsonResponseException: API call to youtube.playlistItems.insert failed with error: Required

Just the word "Required" is not very helpful, but that's all I got, as seen again in this screenshot: Error message

The official error messages page does not have anything listed for this keyword either

Did someone maybe encounter the same error message?


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>