提取 YouTube 频道社区源数据

问题描述 投票:0回答:1

我正在尝试从分析渠道收集社区源数据。 我找不到使用 YouTube Data API v3 的方法。有没有办法提取此类数据?

我想要提取的数据位于社区提要中。例如,这是来自 Dr. 的社区提要。 Bharatendra Rai 频道。我想收集他所有的饲料。

youtube youtube-api data-science youtube-data-api
1个回答
3
投票

再次YouTube Data API v3 不提供基本功能。

我建议您使用我的 开源 YouTube 操作 API,实际上通过请求 https://yt.lemnoslife.com/channels?part=community&id=CHANNEL_ID 您将获得频道社区的 JSON您在

item['community']
中寻找的帖子(文本、图像、视频、没有答案的民意调查、点赞数、评论数、日期等)。

请注意,我的 API 无法检索投票答案,因为它需要与 YouTube 帐户连接。此外,目前我的 API 也不支持检索给定社区帖子的评论。

请注意,我的 API 的 分页 与 YouTube Data API v3 的分页功能相同。

带有 YouTube 频道 ID 的结果示例

UCQxJsAlqmBPAbR_0syDi9mg
:

{
    "kind": "youtube#channelListResponse",
    "etag": "NotImplemented",
    "items": [
        {
            "kind": "youtube#channel",
            "etag": "NotImplemented",
            "id": "UCQxJsAlqmBPAbR_0syDi9mg",
            "community": [
                {
                    "id": "UgkxZ8SQN2CQpX022xUKBJNYCvY3VtGYMrt3",
                    "date": "3 weeks ago",
                    "contentText": [
                        {
                            "text": "Quick question, everyone: Who owns the products that you buy? If the answer is you, shouldn\u2019t you be able to repair what you rightfully own?"
                        }
                    ],
                    "likes": 8,
                    "comments": 1,
                    "videoId": "d4sYQ22Y00k",
                    "image": null,
                    "poll": null,
                    "edited": false
                },
                ...
            ],
            "nextPageToken": "4qmFsgKBARIYVUNReEpzQWxxbUJQQWJSXzBzeURpOW1nGkxFZ2xqYjIxdGRXNXBkSG00QVFDcUF4d0tHRkV3T1ZGbFJ6RktUVVZrUmxNd1VucGpSVzkzVVhjOVBTZ0s4Z1lFQ2dKS0FBJTNEJTNEmgIWYmFja3N0YWdlLWl0ZW0tc2VjdGlvbg=="
        }
    ]
}

更准确地说,您将获得包含以下内容的帖子:

{
    "id": "UgwAKK9XbGapMEH_rNB4AaABCQ",
    "date": "1 year ago",
    "contentText": [
        {
            "text": "Here's to all ten thousand of you \ud83c\udf89\nThis is so much more than a phone \u2013 to Fairphone, to an entire industry, and to our community. It\u2019s a physical expression of everything we believe in and have worked for since we started in 2010. \nWe've got lots of interesting, challenging, exciting content in the works and will do our best to give all of you the video's you're looking for on this channel. \n\nCheers for tuning in! Now let's go add a couple more zero's to that sub count ;)"
        }
    ],
    "likes": 39,
    "comments": 4,
    "videoId": null,
    "image": {
        "thumbnails": [
            {
                "url": "https:\/\/yt3.ggpht.com\/6h9etF2mni8uU6rILsz5K3CGFdzepbPQfivxy0wBwtyheeIXanhMkRvAB4PNnJsQ9VUyXSlNvX_I=s288-c-fcrop64=1,151f0000d51effff-nd-v1",
                "width": 288,
                "height": 288
            },
            {
                "url": "https:\/\/yt3.ggpht.com\/6h9etF2mni8uU6rILsz5K3CGFdzepbPQfivxy0wBwtyheeIXanhMkRvAB4PNnJsQ9VUyXSlNvX_I=s400-c-fcrop64=1,151f0000d51effff-nd-v1",
                "width": 400,
                "height": 400
            },
            {
                "url": "https:\/\/yt3.ggpht.com\/6h9etF2mni8uU6rILsz5K3CGFdzepbPQfivxy0wBwtyheeIXanhMkRvAB4PNnJsQ9VUyXSlNvX_I=s512-c-fcrop64=1,151f0000d51effff-nd-v1",
                "width": 512,
                "height": 512
            },
            {
                "url": "https:\/\/yt3.ggpht.com\/6h9etF2mni8uU6rILsz5K3CGFdzepbPQfivxy0wBwtyheeIXanhMkRvAB4PNnJsQ9VUyXSlNvX_I=s600-c-fcrop64=1,151f0000d51effff-nd-v1",
                "width": 600,
                "height": 600
            }
        ]
    },
    "poll": null,
    "edited": false
}
{
    "id": "UgxjystGgDuX45mgJLp4AaABCQ",
    "date": "1 year ago",
    "contentText": [
        {
            "text": "Super exclusive "
        },
        {
            "text": "#SNEAKPEEK",
            "url": "https:\/\/www.youtube.com\/hashtag\/sneakpeek"
        },
        {
            "text": ":  Here's our co-founder and product lead Miquel Ballester in what used to be our recording studio (we're mid-office-move). Notice the professional cardboard-movingbox-tripod :)\n\nAnyways, Miquel is talking to one of our favorite Youtubers for an upcoming project, that we couldn't be more excited about. \n\nBest guess in the comments wins a personal AMA with Miquel \ud83d\udca1\ud83d\udc47"
        }
    ],
    "likes": 31,
    "comments": 19,
    "videoId": null,
    "image": {
        "thumbnails": [
            {
                "url": "https:\/\/yt3.ggpht.com\/QJeFrnIXTmSqYdH7kr3xGx5S-4DoTFZrvL7XaOlZFnCXk173MviBp7Vaw1SxR_m3n6_ezYqA37W_yg=s288-c-fcrop64=1,00001cdaffffe5d3-nd-v1",
                "width": 288,
                "height": 288
            },
            {
                "url": "https:\/\/yt3.ggpht.com\/QJeFrnIXTmSqYdH7kr3xGx5S-4DoTFZrvL7XaOlZFnCXk173MviBp7Vaw1SxR_m3n6_ezYqA37W_yg=s400-c-fcrop64=1,00001cdaffffe5d3-nd-v1",
                "width": 400,
                "height": 400
            },
            {
                "url": "https:\/\/yt3.ggpht.com\/QJeFrnIXTmSqYdH7kr3xGx5S-4DoTFZrvL7XaOlZFnCXk173MviBp7Vaw1SxR_m3n6_ezYqA37W_yg=s512-c-fcrop64=1,00001cdaffffe5d3-nd-v1",
                "width": 512,
                "height": 512
            },
            {
                "url": "https:\/\/yt3.ggpht.com\/QJeFrnIXTmSqYdH7kr3xGx5S-4DoTFZrvL7XaOlZFnCXk173MviBp7Vaw1SxR_m3n6_ezYqA37W_yg=s640-c-fcrop64=1,00001cdaffffe5d3-nd-v1",
                "width": 640,
                "height": 640
            },
            {
                "url": "https:\/\/yt3.ggpht.com\/QJeFrnIXTmSqYdH7kr3xGx5S-4DoTFZrvL7XaOlZFnCXk173MviBp7Vaw1SxR_m3n6_ezYqA37W_yg=s800-c-fcrop64=1,00001cdaffffe5d3-nd-v1",
                "width": 800,
                "height": 800
            },
            {
                "url": "https:\/\/yt3.ggpht.com\/QJeFrnIXTmSqYdH7kr3xGx5S-4DoTFZrvL7XaOlZFnCXk173MviBp7Vaw1SxR_m3n6_ezYqA37W_yg=s1024-c-fcrop64=1,00001cdaffffe5d3-nd-v1",
                "width": 1024,
                "height": 1024
            },
            {
                "url": "https:\/\/yt3.ggpht.com\/QJeFrnIXTmSqYdH7kr3xGx5S-4DoTFZrvL7XaOlZFnCXk173MviBp7Vaw1SxR_m3n6_ezYqA37W_yg=s1600-c-fcrop64=1,00001cdaffffe5d3-nd-v1",
                "width": 1600,
                "height": 1600
            },
            {
                "url": "https:\/\/yt3.ggpht.com\/QJeFrnIXTmSqYdH7kr3xGx5S-4DoTFZrvL7XaOlZFnCXk173MviBp7Vaw1SxR_m3n6_ezYqA37W_yg=s2048-c-fcrop64=1,00001cdaffffe5d3-nd-v1",
                "width": 2048,
                "height": 2048
            },
            {
                "url": "https:\/\/yt3.ggpht.com\/QJeFrnIXTmSqYdH7kr3xGx5S-4DoTFZrvL7XaOlZFnCXk173MviBp7Vaw1SxR_m3n6_ezYqA37W_yg=s2900-c-fcrop64=1,00001cdaffffe5d3-nd-v1",
                "width": 2900,
                "height": 2900
            }
        ]
    },
    "poll": null,
    "edited": false
}
{
    "id": "UgwSoAm2bGLaJM44UTZ4AaABCQ",
    "date": "1 year ago",
    "contentText": [
        {
            "text": "What type of videos should we focus on in 2021?"
        }
    ],
    "likes": 25,
    "comments": 7,
    "videoId": null,
    "image": null,
    "poll": {
        "choices": [
            {
                "text": "Tutorials, how to's, tips & tricks"
            },
            {
                "text": "Behind the scenes \/ making of"
            },
            {
                "text": "Documentary series about our industry"
            },
            {
                "text": "Explanation-Animation"
            },
            {
                "text": "Community content (Ambassadors, changemakers etc.)"
            }
        ],
        "totalVotes": 138
    },
    "edited": false
}
{
    "id": "UgkxFeexIJyCyz157nuukfI25v_xqFW4_VUi",
    "date": "4 months ago",
    "contentText": [
        {
            "text": "YouTube has a new Creator Liaison, "
        },
        {
            "text": "Rene Ritchie",
            "url": "https:\/\/www.youtube.com\/channel\/UCLBHPoY3NugnZYURxln3fKQ"
        },
        {
            "text": "! He\u2019s worked in product marketing and tech media, posted his first video in 2008 and, for the last two years, has been a full-time YouTuber growing his own channel. Now, he\u2019s here to advocate for creators inside YouTube, to help YouTube better understand and empathize with creators, and to help creators better understand YouTube and everything it has to offer. If you have Platform-level Creator feedback, reach out to Rene at @YouTubeLiaison on Twitter. If you have questions and individual support issues, reach out to @TeamYouTube on Twitter. Welcome, Rene!!"
        }
    ],
    "likes": 2,
    "comments": 510,
    "videoId": null,
    "image": null,
    "poll": null,
    "edited": false
}
© www.soinside.com 2019 - 2024. All rights reserved.