4

How can I check if a YouTube video is available or unavailable for any reason from the URL or video id by using JavaScript in an html website

for example:

this link goes to a video that is available https://www.youtube.com/watch?v=3aY1Z15vTw0

this link goes to a video that is not available https://www.youtube.com/watch?v=FMbz0444444

I want to make it so it does something different depending on whether the video from the link is available or not

if youtube link is available: do something

else: do something else

4

1 回答 1

1

您可以使用list并检查uploadStatus.

可能的状态是:

  • 已删除
  • 失败的
  • 处理
  • 被拒绝
  • 上传
于 2017-06-21T02:07:59.093 回答