# vdl-core

This library helps in downloading videos from multiple social media platforms. Currently supported platforms are: 
- Youtube
- Linkedin
- Instagram


## Usage/Examples

### Download instagram video

```javascript
import { Instagram } from 'vdl-core'; // const { Instagram } = require('vdl-core');

const ins = new Instagram('https://www.instagram.com/p/post_id');
ins.extractVideos().then((res) => {
    if(res.length) {
        Instagram.download(res[0].url);
    }
});
// here, res is [{url: 'download_url'}]
```

### Download youtube video

```javascript
import { Youtube } from 'vdl-core'; // const { Youtube } = require('vdl-core');

const yt = new Youtube('https://www.youtube.com/watch?v=VIDEO_ID');
yt.extractVideos().then((res) => {
    if(res.length) {
        Youtube.download(res[0].url);
    }
});

// here, res is [{url: 'download url', quality: '360p/720p/etc', thumbnail: 'thumbnail image'}]
```

### Download linkedin video

```javascript
import { LinkedIn } from 'vdl-core'; // const { LinkedIn } = require('vdl-core');

const ln = new LinkedIn('https://www.linkedin.com/posts/POST_ID_bla_bla_bla');
ln.extractVideos().then((res) => {
    if(res.length) {
        LinkedIn.download(res[0].url);
    }
});

// here, res is [{url: 'download_url', quality: '360p/720p/etc'}]
```
