Skip to content

Instantly share code, notes, and snippets.

@vishwarajanand
Created February 17, 2022 04:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishwarajanand/4ce5076cda63d0ac2d8df8cef4ea8ae1 to your computer and use it in GitHub Desktop.
Save vishwarajanand/4ce5076cda63d0ac2d8df8cef4ea8ae1 to your computer and use it in GitHub Desktop.
JS snippet to check whether a YouTube video is available or not
// Load a YT URL like https://www.youtube.com/watch?v=XYZABC
let is_not_available = ["video unavailable", "video isn't available"].
some(needle =>
document.getElementById("contents").textContent.toLowerCase().includes(needle));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment