1.0.0 • Published 2 years ago

videolinkapi v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

VIDEOLINKAPI

This module is used to fetch the video download url from a website.

Supports = YouTube, Instagram, Twitter, Kuaishou and Douyin for now, if you want me to add more stuff please create an issue here.

Installation

Make sure you have Node.js installed. Node.js 8.0 or higher is required.

$ npm install videolinkapi

Usage

const videoUrlLink = require('video-url-link');

Get YouTube Info

videoUrlLink.youtube.getInfo(url, [options], callback(error, info))

Example:

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);
    }
});

Get Instagram Info

videoUrlLink.instagram.getInfo(url, [options], callback(error, info))

Example:

videoUrlLink.instagram.getInfo('https://www.instagram.com/p/{ID}', (error, info) => {
    if (error) {
        console.error(error);
    } else {
        console.log(info.list);
    }
});

Get Twitter Info

videoUrlLink.twitter.getInfo(url, [options], callback(error, info))

Example:

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);
    }
});

Get Douyin Info

videoUrlLink.douyin.getInfo(url, [options], callback(error, info))

Example:

videoUrlLink.douyin.getInfo('http://v.douyin.com/{ID}', (error, info) => {
    if (error) {
        console.error(error);
    } else {
        console.log(info.title);
        console.log(info.url);
    }
});

Get Kuaishou Info

videoUrlLink.kuaishou.getInfo(url, [options], callback(error, info))

Example:

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);
    }
});

Supported Sites

SiteURLVideo?Details?
YouTubehttps://www.youtube.com/
抖音https://www.douyin.com/
快手https://www.kuaishou.com/
Instagramhttps://www.instagram.com/
Twitterhttps://twitter.com

Testing

Testing has been done with mocha

npm test