当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Youtube API 3.0 - Missing lilkeCount in statistics

问题描述:

I want to get the likecount and view count for a particular video through Youtube Python API, but I am running into some error.

So, I decided to use the Youtube API - try now feature, and even that seems to fail.

I get the following response:

{

"kind": "youtube#videoListResponse",

"etag": "\"oyKLwABI4napfYXnGO8jtXfIsfc/ov4vQrHRyCqPDg7Vz5rYnV_kqX0\"",

"pageInfo": {

"totalResults": 1,

"resultsPerPage": 1

},

"items": [

{

"kind": "youtube#video",

"etag": "\"oyKLwABI4napfYXnGO8jtXfIsfc/3mmz358ZOYsLZ4S2f0zLLzHJl1A\"",

"id": "j2e2rqczk2U",

"contentDetails": {

"duration": "PT2H8M34S",

"dimension": "2d",

"definition": "sd",

"caption": "false",

"licensedContent": true

},

"status": {

"uploadStatus": "processed",

"privacyStatus": "public",

"license": "youtube",

"embeddable": true,

"publicStatsViewable": true

},

"statistics": {

"viewCount": "212821",

"favoriteCount": "0",

"commentCount": "31"

}

}

]

}

According to the API documentation:

status.publicStatsViewable boolean

This value indicates whether the extended video statistics on the video's watch page are publicly viewable. By default, those statistics are viewable, and statistics like a video's viewcount and ratings will still be publicly visible even if this property's value is set to false.

This variable is true in the above response.

However, likeCount is still missing.

What am I doing incorrectly?

When I open the video on youtube, I do see likeCount.

网友答案:

I asked a similar question one week ago and the Google-API seems to be very restrictive. You can only get the likecount and viewcount if you are the owner of the video.

So as you already said, those information are sadly not in the response. Rather then spending to much on the api, i just did a simple parsing of the youtbe link.

Here ist the Solution:

How to retrieve like/dislike/view count from Youtube?

分享给朋友:
您可能感兴趣的文章:
随机阅读: