本文介绍了Youtube API 2.0 检查视频是否有年龄限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想查看 YouTube 视频是否有年龄限制.没有很多视频,但有些是.我一直在 youtube api 文档和互联网上进行挖掘,但似乎找不到检测到这一点的方法.

I would like to check and see if a youtube video is age restricted. There are not many videos that are, but some are. I have been digging around in the youtube api documents and on the internet, but can't seem to find a way to detect this.

我使用的是 Youtube API V2,一次只查找一个视频.

I am using the Youtube API V2 and only looking for one video at a time.

推荐答案

要检查某个视频是否在给定区域内有(年龄)限制,可以查看 media:rating 属性视频条目,记录在

To check whether a video is (age) restricted in a given region, you can take a look at the media:rating attribute of the video entry, which is documented at

https://developers.google.com/youtube/2.0/reference#youtube_data_api_tag_media:评分

如果您想进行搜索并过滤掉有年龄限制的视频,您可以使用 safeSearch=strict 参数:

If you want to do a search and filter out videos that are age restricted, you can use the safeSearch=strict parameter:

https://developers.google.com/youtube/2.0/reference#safeSearchsp

这篇关于Youtube API 2.0 检查视频是否有年龄限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 19:20