ChannelSections
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
channelSection
资源包含一组
与频道精选的视频进行比较例如,版块可以推介某个频道的
最新上传的视频、最热门的上传视频或一个或多个播放列表中的视频。
一个频道最多可以创建 10 个频道架。
属性
下表定义了此资源中显示的属性:
属性 |
kind |
string
标识 API 资源的类型。其值将为 youtube#channelSection 。 |
etag |
etag
此资源的 Etag。 |
id |
string
YouTube 用来唯一标识频道版块的 ID。 |
snippet |
object
snippet 对象包含有关频道版块的基本详情,例如其类型和标题。 |
snippet.type |
string
渠道版块的类型。
此属性的有效值如下:
allPlaylists
completedEvents
liveEvents
multipleChannels
multiplePlaylists
popularUploads
recentUploads
singlePlaylist
subscriptions
upcomingEvents
|
snippet.channelId |
string
YouTube 用来唯一标识发布频道版块的频道。 |
snippet.title |
string
相应版块的标题。你只能为 snippet.type 值为 multiplePlaylists 或 multipleChannels 的频道版块设置标题,而且事实上,在插入或更新这两类版块中的任何一种时,你都必须指定标题。如果您为其他类型的频道版块指定标题,该值将被忽略。
此属性的值最长为 100 个字符,可能包含除 < 和 < 之外的所有有效 UTF-8 字符。 |
snippet.position |
unsigned integer
版块在频道页上的位置。此属性使用索引(从 0 开始)。值 0 表示频道上显示的第一个部分,值 1 表示第二个部分,以此类推。
如果您在插入频道版块时未指定此属性的值,默认行为是最后显示新版块。 |
contentDetails |
object
contentDetails 对象包含有关频道版块内容的详细信息,例如版块精选的播放列表或频道列表。 |
contentDetails.playlists[] |
list
在频道版块中展示的一个或多个播放列表 ID 的列表。如果 channelSection 资源的 snippet.type 属性为 singlePlaylist 或 multiplePlaylists ,您必须指定播放列表 ID 列表,并且不应为其他类型的版块指定此属性。如果类型为 singlePlaylist ,则此列表只能指定一个播放列表 ID。 |
contentDetails.channels[] |
list
频道版块中展示的一个或多个频道 ID 的列表。如果 channelSection 资源的 snippet.type 属性为 multipleChannels ,则您必须指定频道 ID 列表,并且不应为其他类型的版块指定此属性。您不能在列表中添加自己的频道。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-21。
[[["易于理解","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):2025-08-21。"],[[["\u003cp\u003eA \u003ccode\u003echannelSection\u003c/code\u003e resource contains information about a set of videos that a channel features, such as latest uploads, popular uploads, or playlists.\u003c/p\u003e\n"],["\u003cp\u003eChannels can manage their featured videos using the API, which allows creating, listing, updating, and deleting \u003ccode\u003echannelSection\u003c/code\u003e resources.\u003c/p\u003e\n"],["\u003cp\u003eA channel can have a maximum of 10 sections, each with a specified type like \u003ccode\u003esinglePlaylist\u003c/code\u003e, \u003ccode\u003emultipleChannels\u003c/code\u003e, or \u003ccode\u003epopularUploads\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach \u003ccode\u003echannelSection\u003c/code\u003e has properties such as \u003ccode\u003ekind\u003c/code\u003e, \u003ccode\u003eetag\u003c/code\u003e, \u003ccode\u003eid\u003c/code\u003e, \u003ccode\u003esnippet\u003c/code\u003e, and \u003ccode\u003econtentDetails\u003c/code\u003e, which specify details about the section and its contents.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003econtentDetails\u003c/code\u003e property can contain a list of either playlists or channels featured in the section, depending on the \u003ccode\u003esnippet.type\u003c/code\u003e property.\u003c/p\u003e\n"]]],["Channel sections feature a curated set of videos, like latest or popular uploads, or playlists. API methods allow listing, inserting, updating, and deleting these sections. A channel can have up to 10 sections. Each section contains `snippet` and `contentDetails` objects which describes the type, title, position, and the featured channels/playlists. The type can be single or multiple playlists, or channels, amongst others. Specific titles are required for some types and cannot include \"\u003c\" or \"\u003e\".\n"],null,[]]