Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

parse youtu.be url and get time

// Parse youtu.be URL and get time:

const url = "https://youtu.be/abc123?t=660";
const re = /?t=([d]+)/i;
const match = url.match(re);
if ( match ) console.log( match[1] );
// Outputs: 660
 
PREVIOUS NEXT
Tagged: #parse #url #time
ADD COMMENT
Topic
Name
5+8 =