Youtube.parseVideoId()

Parse the video ID from the provided YouTube.com URL.

Usage

Hover over inputs/exits for more info.

var Youtube = require('machinepack-youtube');


// Parse the video ID from the provided YouTube.com URL.

Youtube.parseVideoId({

url: 'https://www.youtube.com/watch?v=TruIq5IxuiU',

}).execSync();

Inputs

url required

The URL of a Youtube Video.

'https://www.youtube.com/watch?v=TruIq5IxuiU'

Exits

error

An unexpected error occurred.

invalidUrl

Unable to parse a video id from the provided YouTube URL.

success

OK.

'TruIq5IxuiU'