【发布时间】:2021-06-09 02:00:12
【问题描述】:
我正在为我的项目使用 YouTube 数据 API v3,我想知道是否通过此 API 调用:
https://www.googleapis.com/youtube/v3/commentThreads?key=YOUR_KEY&textFormat=plainText&part=snippet&maxResults=5&order=relevance&videoId=YOUR_ID,
我能不能得到那个视频的标题?
这是我从这个 API 得到的:
{
"kind": "youtube#commentThreadListResponse",
"etag": "KcqDjUnisqZz_7Kr1dfxHxM4jSM",
"nextPageToken": "QURTSl9pMUxESzFEZk53RV9nNnUzRWx6S2VQY1A5QVpPS2JrZUltdnl2MzhidmM4bzRaY1ZTa1ZzaXBQbGdiYWd0LXRvc1lTVzJQSHdnLXdKRW11MzlDMHp1WGpFS1dCVEczb0hXZ3JhcEQ0b3FnVlprb1duRUJTWVh1d0J1dzVJdw==",
"pageInfo": {
"totalResults": 5,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#commentThread",
"etag": "h3h5DKe5ApoaVan5iX4vC2glnYA",
"id": "Ugxxqkvik0jDB9_WSth4AaABAg",
"snippet": {
"videoId": "8juRm9I__uk",
"topLevelComment": {
"kind": "youtube#comment",
"etag": "pjDNsBFra34PxM9VOQtI49R9-_Y",
"id": "Ugxxqkvik0jDB9_WSth4AaABAg",
"snippet": {
"videoId": "8juRm9I__uk",
"textDisplay": "Nyesel beli realme 3 pro ????????",
"textOriginal": "Nyesel beli realme 3 pro ????????",
"authorDisplayName": "Dodi Satria",
"authorProfileImageUrl": "https://yt3.ggpht.com/ytc/AAUvwnir7Yxd0qmDbKtLo568c7RKbDQvGlFeq_LjlGxM4A=s48-c-k-c0xffffffff-no-rj-mo",
"authorChannelUrl": "http://www.youtube.com/channel/UC28fGIqdC7B1y5BRVhmI8Eg",
"authorChannelId": {
"value": "UC28fGIqdC7B1y5BRVhmI8Eg"
},
"canRate": true,
"viewerRating": "none",
"likeCount": 3,
"publishedAt": "2019-08-01T11:52:39Z",
"updatedAt": "2019-08-01T11:52:39Z"
}
},
"canReply": true,
"totalReplyCount": 1,
"isPublic": true
}
},
视频ID在那里,但我可以得到视频的标题吗?
【问题讨论】:
-
你有视频 ID 是否尝试获取视频?
-
我确实收到了视频,但我怎么能通过一个请求做到这一点?高效
标签: api youtube-api youtube-data-api