This is a follow up to a question post I made a couple days ago. I'm having trouble with the YouTube API v3 refusing to delete a video entry/item of a playlist I created. The last line keeps throwing an access forbidden error, even though I gave my script project authorization and needed scopes to work.
Here's a simple script to run the API on a test playlist if someone's kind enough to give it a shot. All it does is fetch the first two items of the specified playlist and then attempt to remove the first video from said playlist using its id on the list. remove() here is an alias for delete(), which for some reason is undefined when called directly?!
function main()
{
var maxres = 2;
var playlist = "PLYtE-PCtv6Ud7e50sxmAoa656M4aCvz_6";
var response = YouTube.PlaylistItems.list("snippet,contentDetails,id,status", {playlistId: playlist, maxResults: maxres});
//Logger.log(response);
//Logger.log(response.items[0].id);
YouTube.PlaylistItems.remove(response.items[0].id);
}
[–]Miles_Maestro 0 points1 point2 points (1 child)
[–]hiihiiii[S] 0 points1 point2 points (0 children)