Created
January 6, 2023 20:16
-
-
Save cassidoo/c9e2987dc0fd12491b31f5cb57630f00 to your computer and use it in GitHub Desktop.
Get YouTube ID with JavaScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let url = "https://www.youtube.com/watch?v=nVvxOwxuk_w"; | |
url = url.split("v=")[1].split("&")[0]; // this removes out any extra parameters, like a playlist point etc | |
console.log(url); | |
// id = nVvxOwxuk_w |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment