gpt4 book ai didi

youtube - YouTube API 3 channel 的用户名和ID不一致

转载 作者:行者123 更新时间:2023-12-03 05:49:50 26 4
gpt4 key购买 nike

最佳答案

when I search for a channel by ID .. I get no items returned.



尝试使用 Try-it section的channels.list。我可以使用以下参数来获取JSON响应:
 part->contentDetails
id-> yourchannel ID

Authorize and Execute

它返回的响应根本不是空的。
{
"kind": "youtube#channelListResponse",
"etag": "\"I_8xdZu766_FSaexEaDXTIfEWc0/FiuYcDu7WFmoFVcLDRvENYGl_tQ\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{

"kind": "youtube#channel",
"etag": "\"I_8xdZu766_FSaexEaDXTIfEWc0/QjMybH99xT3x-znrh2Yerx_0DWk\"",
"id": "{my channel id}",
"snippet": {
"title": "{my channel name}",
"description": "",
"publishedAt": "2011-10-10T15:30:40.000Z",
"thumbnails": {
"default": {
"url": "https://yt3.ggpht.com/-EN5H1HDHqIU/ABCDEFGHIJK/ABCDEFGHIJK/l2gqeYg94P8/s88-c-k-no-mo-rj-c0xffffff/photo.jpg"
},
"medium": {
"url": "https://yt3.ggpht.com/-EN5H1HDHqIU/ABCDEFGHIJK/ABCDEFGHIJK/l2gqeYg94P8/s240-c-k-no-mo-rj-c0xffffff/photo.jpg"
},
"high": {
"url": "https://yt3.ggpht.com/-EN5H1HDHqIU/ABCDEFGHIJK/ABCDEFGHIJK/l2gqeYg94P8/s240-c-k-no-mo-rj-c0xffffff/photo.jpg"
}
},
"localized": {
"title": "{my channel name}",
"description": ""
}
}
}
]
}

对我来说,这是很多结果。

But when I search by userName, it returns the channel ID that I just searched for.



在上面的channels.list try-it文档中, forUsername定义为 forUsername参数指定YouTube用户名,从而请求与该用户名关联的 channel 。因此,我认为它正在发挥作用。

有关 forUsername参数的附加说明是,它用于使用API​​的v3将您的任意旧版YouTube用户名(即旧的YouTube帐户)转换为 channel ID。 Work with Channel IDs指南中有更多内容。

关于youtube - YouTube API 3 channel 的用户名和ID不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39378768/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com