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

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

问题描述

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

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:state 标签

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天全站免登陆