以编程方式确定 Youtube 视频是否已被下架 [英] Programmatically determine whether a Youtube video has been taken down

查看:33
本文介绍了以编程方式确定 Youtube 视频是否已被下架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从 YouTube 获得了 Rap Exegesis 上的大部分音乐(以嵌入式播放器的形式).不幸的是,我正在使用的一个视频总是存在被删除的风险(由于版权问题或其他原因),从而破坏我网站上的相应页面.

I'm getting most of the music on Rap Exegesis from YouTube (in the form of embedded players). Unfortunately, there's always the risk that one of the videos I'm using will be taken down (due to copyright issues or whatever), thereby breaking the corresponding page on my site.

理想情况下,我会有一个 cronjob 来检查(每晚说)是否有任何视频被删除并通知我.这样做的最佳方法是什么?

Ideally I would have a cronjob that would check (nightly say) whether any videos had been removed and notify me. What's the best way to do this?

推荐答案

您需要的信息可通过 YouTube API,特别是在 yt:状态标签

The information you need is available via the YouTube API, specifically in the yt:state tag

根据您使用的编程语言,有大量用于与 YouTube API 交互的代码.

Depending what language you are programming in there is lots of code around for interacting with the YouTube API.

如果您仍然无法使用此功能,请在此处发布更多详细信息.

Post here with more details if you are still having issues getting this to work.

这篇关于以编程方式确定 Youtube 视频是否已被下架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆