2.8.3 • Published 7 months ago

youtube-dlsr v2.8.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

youtube-dlsr

NPM Version NPM Downloads

Installing

npm install youtube-dlsr

GitHub

Example

Automatic format selection

const { download, search } = require('youtube-dlsr');
const { createWriteStream } = require('fs');

(async () => {
    // Search video.
    const result = await search('no copyright music', { type: 'video', limit: 1 });
    // Get suitable stream for live video or music bots.
    const stream = await download(result[0].url);
    // Write to file.
    stream.pipe(createWriteStream('./auto_no_copyright_music.ogg'));
})();

Manually format selection

const { getVideoInfo, search } = require('youtube-dlsr');
const { createWriteStream } = require('fs');

(async () => {
    // Search video.
    const result = await search('no copyright music', { type: 'video', limit: 1 });
    // Get info of video.
    const video = await getVideoInfo(result[0].url);
    // Get stream of selected format.
    const stream = video.download((f) => f.hasAudio);
    // Write to file.
    stream.pipe(createWriteStream('./manual_no_copyright_music.mp3'));
})();

Get playlist information

const { getPlaylistInfo, search } = require('youtube-dlsr');

(async () => {
    // Search playlist.
    const result = await search('no copyright music', { type: 'playlist', limit: 2 });
    // Get first page info of playlist.
    const list1 = await getPlaylistInfo(result[0].url);
    // Get full page info of playlist.
    const list2 = await getPlaylistInfo(result[1].url, true);
})();
2.8.3

7 months ago

2.8.1

1 year ago

2.8.0

1 year ago

2.8.2

1 year ago

2.7.4

2 years ago

2.7.3

2 years ago

2.7.2

2 years ago

2.7.1

2 years ago

2.7.0

2 years ago

2.6.1

2 years ago

2.6.0

2 years ago

2.6.2

2 years ago

2.5.0

2 years ago

2.3.0

2 years ago

2.3.2

2 years ago

2.2.3

2 years ago

2.4.0

2 years ago

2.3.1

2 years ago

2.2.2

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.2.6

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

1.2.4

3 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.2.3

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.5

3 years ago

1.0.6

3 years ago

1.1.4

3 years ago

1.0.5

3 years ago

1.2.2

3 years ago

1.1.3

3 years ago

1.2.1

3 years ago

1.1.2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.0

3 years ago