google-apps-script - 无法将视频插入稍后观看 (WL) 播放列表

标签 google-apps-script youtube-api youtube-data-api

我的 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 and playlistItems.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/

相关文章:

google-apps-script - 未知函数: 'getFontColor'

api - I18nLanguages不起作用?

youtube - 通过 Youtube Api 上传 360 度全景视频

javascript - Jquery管状加载多个实例

javascript - YouTube 在身份验证时要求选择 channel

php - 如何使 google oauth2 的访问 token 根本不会过期?

android - 无法加载现代控件 UI。无法全屏播放 YouTube 视频

javascript - UrlFetchApp.fetch - 缺少网页代码。如何获取完整代码?

google-apps-script - Apps 脚本 - 如何检测对话框是否关闭

google-apps-script - 谷歌驱动器 API 对每个帐户或项目有限制吗?