title: Check if a video on YouTube is available from the URL using JavaScript
body: <p>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</p>
  
  <p>for example:</p>
  
  <p>this link goes to a video that is available 
  <a href="https://www.youtube.com/watch?v=3aY1Z15vTw0" rel="nofollow noreferrer">https://www.youtube.com/watch?v=3aY1Z15vTw0</a></p>
  
  <p>this link goes to a video that is not available
  <a href="https://www.youtube.com/watch?v=FMbz0444444" rel="nofollow noreferrer">https://www.youtube.com/watch?v=FMbz0444444</a></p>
  
  <p>I want to make it so it does something different depending on whether the video from the link is available or not</p>
  
  <p>if youtube link is available:
  do something</p>
  
  <p>else:
  do something else</p>