使用 YouTube Data API 将视频识别为广告

发布于 2025-01-15 13:10:14 字数 87 浏览 3 评论 0 原文

我主要使用视频和搜索列表资源类型。我想过滤视频广告的结果。我本来希望广告是一个视频类别,或者视频广告有另一个标识符,但到目前为止我还没有找到方法。有什么想法吗?

I'm using mostly the video and search list resource types. I want to filter the results for video ads. I had hoped that ads would be a video category or there would be another identifier for video ads, but I haven't been able to find a way so far. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

森罗 2025-01-22 13:10:14

不幸的是(AFAIK),其中一些广告视频是不公开视频 - 请参阅这些 (12) 我在观看随机 YouTube 视频时提取的广告视频示例 - 此 广告视频公开的

查询其中一个视频的数据时(uuh2wkRmodI) - 查看 API 文档中使用试用功能的示例 - ,我没有看到任何相关信息表明这是一个广告视频 - 除了是一个不公开的视频。

也许,你可以考虑它的统计数据 - 我发现奇怪的是,一个视频没有喜欢,没有收藏,没有评论,并且有观看次数:

"statistics": {
  "viewCount": "32",
  "likeCount": "0",
  "favoriteCount": "0",
  "commentCount": "0"
}

由于这些是不公开的广告视频,因此无法通过 API 进行搜索。 引用

如果视频作为不公开视频上传,该属性值也会
指定视频上传的日期和时间。在这种情况下,
任何知道视频唯一视频 ID 的人都可以检索该视频
元数据

除非您以某种方式设法获取在正常视频开始之前出现的这些广告的 VIDEO_ID,否则您无法通过 YouTube 或其 API 真正搜索这些视频。

我的额外猜测是,这些广告视频也是由 YouTube 本身在观看者所在地区(国家)设置的(除了其他设置),并且这些广告视频的所有者付费YouTube 嵌入他们的广告。

如果您想尝试一下,请尝试搜索来自知名产品品牌渠道的视频,并仅获取他们的公开视频和某种短视频(我不是在谈论#shorts,但是,持续时间为一分钟半或更短的视频)。

此外,请考虑到某些广告视频可能会更长,因此,在简历中:您必须使用公开的内容。

Unfortunately (AFAIK), some of those ads videos are unlisted videos - see these (1 and 2) ads videos examples I extracted while watching a random YouTube video - this ads video is public, though.

While querying the data of one of these videos (i.e. uuh2wkRmodI) - see the example using the try-it feature in the API documentation - , I don't see any relevant information that points me this is an advertisement video - other than being an unlisted video.

Probably, you can consider its statistics - I found odd that a video has no likes, no favorites no comments AND has views:

"statistics": {
  "viewCount": "32",
  "likeCount": "0",
  "favoriteCount": "0",
  "commentCount": "0"
}

Since those are unlisted ads videos, those cannot be searched via the API. Quote:

If a video is uploaded as an unlisted video, the property value also
specifies the date and time that the video was uploaded. In this case,
anyone who knows the video's unique video ID can retrieve the video
metadata
.

Unless you somehow manages to get the VIDEO_IDs of those ads appearing before a normal video starts, you cannot really search those videos neither by YouTube or its API.

My additional guess is also those ads videos are set by YouTube itself based (aside other settings) in the region (country) of the viewer and the owner of those ads videos pays to YouTube for embed their advertisements.

If you want to try it out, then, try to search for videos that came from channels of recognized product brands and get only their public and kind of short videos (I'm not talking abuot #shorts, but, videos with a duration of a half on a minute or less).

Additionally, take into account that some ads videos might be longer, so, in resume: you have to work with what is publicly available.

別甾虛僞 2025-01-22 13:10:14

使用我的开源 < a href="https://yt.lemnoslife.com" rel="nofollow noreferrer">YouTube 操作 API 您可以通过在 https://yt.lemnoslife.com/videos?part=isPaidPromotion&id=VIDEO_ID

以下是视频 ID 示例:

然后你必须发现全部 YouTube 视频,除非您寻找特定的关键字等,否则有这种困难的方法,其中包括获取初始的 YouTube 频道集,获取他们的视频,获取每个视频的评论,从评论中获取 YouTube 频道等等。

With my open-source YouTube operational API you have access to whether or not a given video is a paid promotion by fetching the isPaidPromotion boolean in the JSON file at https://yt.lemnoslife.com/videos?part=isPaidPromotion&id=VIDEO_ID

Here are examples of videos ids:

Then you have to discover all YouTube videos, to do so except if you look for specific keywords etc, there is this difficult method which consists in getting an initial set of YouTube channels, fetching their videos, fetching the comments on each video, fetching the YouTube channels from the comments and so on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文