PlaylistImages: insert
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
将图片添加到播放列表。
此方法支持媒体上传。上传的文件必须符合以下限制条件:
- 文件大小上限:2MB
- 接受的宽高比:1:1(方形)
- 接受的媒体 MIME 类型:
image/jpeg
、image/png
配额影响:调用此方法将产生 50 个单位的配额费用。
请求
HTTP 请求
POST https://www.googleapis.com/youtube/v3/playlistImages
授权
此请求需要获得以下至少一个范围的授权(详细了解身份验证和授权)。
范围 |
https://www.googleapis.com/auth/youtubepartner |
https://www.googleapis.com/auth/youtube |
https://www.googleapis.com/auth/youtube.force-ssl |
参数
下表列出了此查询支持的参数。列出的所有参数均为查询参数。
参数 |
必需参数 |
part |
string
part 参数指定了一个
包含一个或多个 playlistImage 资源的逗号分隔列表
API 响应将包含的属性。
如果参数
表示包含子属性的属性,子属性
会包含在响应中。
|
可选参数 |
onBehalfOfContentOwner |
string
此参数只能在适当授权的请求中使用。注意:此参数专用于 YouTube 内容合作伙伴。
onBehalfOfContentOwner 参数用于指明请求的授权凭据可标识代表参数值中指定的内容所有者执行操作的 YouTube 内容管理系统用户。此参数适用于拥有和管理多个不同 YouTube 频道的 YouTube 内容合作伙伴。有了它,内容所有者只需验证一次身份,即可访问自己所有的视频和频道数据,而无需为每个频道提供身份验证凭据。用户进行身份验证时使用的内容管理系统账号必须与指定的 YouTube 内容所有者相关联。 |
onBehalfOfContentOwnerChannel |
string
此参数只能在适当授权的请求中使用。注意:此参数仅适用于 YouTube 内容合作伙伴。
onBehalfOfContentOwnerChannel 参数
用于指定视频所面向的频道的 YouTube 频道 ID
已添加。如果请求为
onBehalfOfContentOwner 参数,且只能在
与该参数结合使用。此外,该请求必须是
使用与内容所有者的
onBehalfOfContentOwner 参数指定。最后,
onBehalfOfContentOwnerChannel 参数值的通道
指定的广告必须与内容拥有者相关联的
onBehalfOfContentOwner 参数指定的值。
此
参数适用于拥有和管理许多
不同 YouTube 频道它允许内容所有者进行身份验证一次
并代表参数中指定的渠道执行操作
而无需为每个字段提供身份验证凭据
独立频道 |
请求正文
在请求正文中提供 playlistImages 资源。
对于该资源:
-
您必须为以下属性指定一个值:
snippet.playlistId
snippet.type
-
您可以为以下属性设置值:
snippet.width
snippet.height
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-16。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-08-16。"],[[["This API method adds an image to a playlist, supporting media uploads with a maximum file size of 2MB and a 1:1 aspect ratio, and only accepts `image/jpeg` and `image/png` MIME types."],["Using this method requires authorization with scopes such as `https://www.googleapis.com/auth/youtubepartner`, `https://www.googleapis.com/auth/youtube`, or `https://www.googleapis.com/auth/youtube.force-ssl`."],["The `part` parameter is required to specify the `playlistImage` resource properties to be included in the API response."],["The `onBehalfOfContentOwner` and `onBehalfOfContentOwnerChannel` parameters are available for YouTube content partners managing multiple channels to authenticate once and access data across all channels."],["The request body requires a `playlistImages` resource with `snippet.playlistId` and `snippet.type`, and it can include optional `snippet.width` and `snippet.height` properties."]]],["To add an image to a playlist, send a POST request to `https://www.googleapis.com/youtube/v3/playlistImages`, ensuring authorization with appropriate scopes. Uploaded images must be square (1:1 aspect ratio), under 2MB, and be either JPEG or PNG. The request requires the `part` parameter, and the request body must include `snippet.playlistId` and `snippet.type`. Optional parameters include `onBehalfOfContentOwner` and `onBehalfOfContentOwnerChannel`. A successful call returns a `playlistImages` resource and has a quota cost of 50 units.\n"]]