get youtube id from url

// true when ID is found, false otherwise. 
//Extracts youtube ID
<script type="text/javascript">
function youtube_parser(url){
    var regExp = /^https?\:\/\/(?:www\.youtube(?:\-nocookie)?\.com\/|m\.youtube\.com\/|youtube\.com\/)?(?:ytscreeningroom\?vi?=|youtu\.be\/|vi?\/|user\/.+\/u\/\w{1,2}\/|embed\/|watch\?(?:.*\&)?vi?=|\&vi?=|\?(?:.*\&)?vi?=)([^#\&\?\n\/<>"']*)/i;
    var match = url.match(regExp);
    return (match && match[1].length==11)? match[1] : false;
}
</script>

3.6
5
Awgiedawgie 440220 points

                                    &lt;script type=&quot;text/javascript&quot;&gt;
function youtube_parser(url){
    var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&amp;?]*).*/;
    var match = url.match(regExp);
    return (match&amp;&amp;match[7].length==11)? match[7] : false;
}
&lt;/script&gt;

These are the types of URLs supported

http://www.youtube.com/watch?v=0zM3nApSvMg&amp;feature=feedrec_grec_index
http://www.youtube.com/user/IngridMichaelsonVEVO#p/a/u/1/QdK8U-VIH_o
http://www.youtube.com/v/0zM3nApSvMg?fs=1&amp;amp;hl=en_US&amp;amp;rel=0
http://www.youtube.com/watch?v=0zM3nApSvMg#t=0m10s
http://www.youtube.com/embed/0zM3nApSvMg?rel=0
http://www.youtube.com/watch?v=0zM3nApSvMg
http://youtu.be/0zM3nApSvMg

3.6 (5 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
youtube get id without url get youtube url from id convert youtube url to id fetching video id from youtube url in js extract id from youtube url get youtube video info javascript get video name from youtube id javascript get video name from youtube url javascript youtube url id examples youtube video id extract by javascript javascript youtube id by url javascript youtube id in url get youtube video id js RETRIEVE YOUTUBE VIDEO DETAILS USING JAVASCRIPT js get youtube video from link what is the id in youtube url get youtube video url from id javascript to get youtube video id js how to get youtube video id how to get youtube account id from account url get video id youtube javascript get youtube id from url c# extract youtube id js get related video from youtube url js get youtube video information from url javascript all youtube links format get id js get youtube id javascript get youtube id javascript youtube id js get youtube video id get url of video youtube javascript open id youtube get youtube video from url javascript youtube get current video id from html youtube get video id from url javascript youtube Id from url How to get youtube video id from url javaScript How to get youtube video id from put javaScript How to get youtube video id from put call in javaScript How to get youtube video id from URL JavaScript get youtube video id from url using javascript get youtube id with javascript in url watch how to get video id from youtube url get youtube video url javascript get youtube thumbnail from url get youtube channel id youtube get your channel url extract video id from youtube url js get video id from url js youtube video get statis how to play a youtube video by id javascript js get video id from youtube url get video id from youtube url regex get id video youtube javascript get youtube id from url js fonction js get youtube id regex to get youtube video id js get youtube video id from url get youtube link name in javascript how to get youtube video id how to get the id of a youtube video youtube API how to get the youtube video id get youtube video from id javascript youtube url get video id youtube video id how to get video id from youtube url in javascript how to get youtube id from all youtube links jquery get youtube id from url how to extract youtube video id from url in vuejs how to extract youtube video id from url get youtube video id from url in react native get youtube video id from url js get videoid from youtube url js regexp parse youtube id extract video id from url get channel id from youtube url check youtube video link javascript regex to extract youtube video id javascript extract youtube id from url js parse youtube video id get youtube channel id from url get youtube id from url regex javascript get just the id from youtube url youtube link get only video id get id from youtube link play youtube url from video id get id from url youtube youtube vedio id get youtube vide unique code in javascript get video id from url get id from youtube url javascript get youtube video id from url how access video id from website get youtube id from url youtube video url to id youtube videoId javascript find youtube video id javascript find youtube video js get id video youtube of url what is javascript url in youtube how to get current youtube video id in javascript how to get playing id of youtube video in javascript what is youtube js url get video id from youtube link regex youtube id js extract youtube id from link extract youtube idfrom link function to extract youtube id from youtube link in react native function to extract youtube id from youtube link how get id video from youtube link js fetch youtube video id from url js get id from youtube url how to get youtube video id from url regular expression for gettin youtube video id get youtube video url by name javascript get youtube url from video id how to parse youtube video url how to get youtube link with javascript Extract video ID from its URL (e.g. using regex) get name of video from youtube id javascript get video id from youtube url javascript get video id from youtube url get video id from youtube embed javascrit how to get youtube id from url youtube url string get video id from youtube url js how to get youtube video id javascript get video id from youtube embed url javascript get id from youtube url javascript video.id is not workking in js regex get youtube video id get youtube code from url javascript get youtube url from string javascript get video id from youtube url javascript javascript video id youtube javascript get youtube id from link js get youtube video link from string js get youtube link to video from text youtube video id regex javascript how to get the url from youtube video in js javascript detect youtube string get video id from youtube watch link javascript if string youtube link javascript get video id from youtube link js js get yt id from url angular extract youtube video link from url wextract youtube video code from url get id from youtube embed code javascript javascript extract youtube video id from ult youtube url fetch key js js get youtube id from url vuejs get id youtube url javascript get youtube id from url regex to get youtube id from url js take the id of video javascript youtube url to ID video id youtube video id from url build youtube url from id extract youtube video id online vuejs youtube url split video id from youtube url get youtube video id from url get youtube video id from url javascript
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source