This module is used to get the video download url link from the website.
Module in pure javascript for node.js
Supported Sites: YouTube, Instagram, Twitter, 抖音, 快手
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 8.0 or higher is required.
Installation is done using the
npm install command:
$ npm install video-url-linkconst videoUrlLink = require('video-url-link');videoUrlLink.youtube.getInfo(url, [options], callback(error, info))
videoUrlLink.youtube.getInfo('https://youtu.be/{ID}', { hl: 'en' }, (error, info) => {
if (error) {
console.error(error);
} else {
console.log(info.details);
console.log(info.formats);
}
});videoUrlLink.douyin.getInfo(url, [options], callback(error, info))
videoUrlLink.douyin.getInfo('http://v.douyin.com/{ID}', (error, info) => {
if (error) {
console.error(error);
} else {
console.log(info.title);
console.log(info.url);
}
});videoUrlLink.kuaishou.getInfo(url, [options], callback(error, info))
videoUrlLink.kuaishou.getInfo('http://www.gifshow.com/s/{ID}', (error, info) => {
if (error) {
console.error(error);
} else {
console.log(info.title);
console.log(info.url);
}
});videoUrlLink.instagram.getInfo(url, [options], callback(error, info))
videoUrlLink.instagram.getInfo('https://www.instagram.com/p/{ID}', (error, info) => {
if (error) {
console.error(error);
} else {
console.log(info.list);
}
});videoUrlLink.twitter.getInfo(url, [options], callback(error, info))
videoUrlLink.twitter.getInfo('https://twitter.com/{@}/status/{ID}', {}, (error, info) => {
if (error) {
console.error(error);
} else {
console.log(info.full_text);
console.log(info.variants);
}
});| Site | URL | Video? | Details? |
|---|---|---|---|
| YouTube | https://www.youtube.com/ | ✓ | ✓ |
| 抖音 | https://www.douyin.com/ | ✓ | ✓ |
| 快手 | https://www.kuaishou.com/ | ✓ | ✓ |
| https://www.instagram.com/ | ✓ | ✓ | |
| https://twitter.com | ✓ | ✓ |
Tests are written with mocha
npm test