video-url-normalizer

1.0.0 • Public • Published

video-url-normalizer

This npm package normalizes the URL of different video hosting services

This module is intended to be used to normalize the URLs of different video hosting sites. The normalized URLs are not necessarily the canonical URLs of the videos. Each valid video URL has an ID which is unique at its specific hoster.

Usage

var normalizeVideoUrl = require('video-url-normalizer');
var urlToVideo = 'http://www.youtube.com/watch?v=abcdefghijk&feature=feedrec_grec_index';
 
var obj = normalizeVideoUrl(urlToVideo);
assert(obj.hoster === 'youtube');
assert(obj.id === 'abcdefghijk');
assert(obj.url === 'http://www.youtube.com/watch?v=abcdefghijk');

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i video-url-normalizer

    Weekly Downloads

    3

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • bdadam