我的 Google Apps 脚本已经运行了一段时间,没有出现错误。
它从我的 RSS 提供商获取新的 RSS 提要项目,从 YoutTbe 获取有关视频的一些基本信息,然后根据该信息将视频添加到特定播放列表。
从几天前开始,虽然其余播放列表工作正常,但将任何视频添加到 WL(稍后观看)播放列表会导致以下错误:
GoogleJsonResponseException: API call to youtube.playlistItems.insert failed with error: The API does not support the ability to insert videos into the specified playlist.
这是我发送的请求(同样,为我创建的另外两个播放列表工作):
{
snippet: {
playlistId: 'WL',
resourceId: {
videoId: '<videoId>',
kind: 'youtube#video'
}
}
}
它的使用方式如下:
YouTube.PlaylistItems.insert(resource, "snippet");
此外,我确实在脚本开头记录了 WL 播放列表的内容,并且播放列表项目以空列表的形式返回(尽管该列表中有视频)。据我所知,这两个问题是同时开始的。
最佳答案
根据entry from September 9, 2020根据 YouTube 数据 API 的官方修订历史记录,稍后观看播放列表已被弃用,不能与 PlaylistItems.insert
一起使用。 API端点:
[...] The
playlistItems.insert
method's andplaylistItems.delete
method's support for these playlists are also now fully deprecated [...]
entry from January 28, 2021指出:
[...] While users' watch history and watch later lists are, indeed, not accessible via the API [...]
因此,您必须承认您的 PlaylistItems.insert
端点用例不再有效。
这很不幸,但这是一个(有记录的)事实。
关于google-apps-script - 无法将视频插入稍后观看 (WL) 播放列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66156461/