# yt-playlist-downloader

> A tool for downloading YouTube playlists.

Latest version **1.1.4** (published 2023-05-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install yt-playlist-downloader
pnpm add yt-playlist-downloader
yarn add yt-playlist-downloader
bun add yt-playlist-downloader
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2023-05-24 |
| First published | 2023-05-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tomasbarak |

## Links

- npm: https://www.npmjs.com/package/yt-playlist-downloader
- Repository: https://github.com/tomasbarak/youtube-playlist-downloader
- Homepage: https://github.com/tomasbarak/youtube-playlist-downloader#readme
- Issues: https://github.com/tomasbarak/youtube-playlist-downloader/issues
- npm.io page: https://npm.io/package/yt-playlist-downloader

## Dependencies (8)

- [ytpl](https://npm.io/package/ytpl.md) ^2.3.0
- [axios](https://npm.io/package/axios.md) ^1.4.0
- [node-id3](https://npm.io/package/node-id3.md) ^0.2.6
- [ytdl-mp3](https://npm.io/package/ytdl-mp3.md) ^3.1.0
- [ytdl-core](https://npm.io/package/ytdl-core.md) ^4.11.4
- [ffmpeg-static](https://npm.io/package/ffmpeg-static.md) ^5.1.0
- [fluent-ffmpeg](https://npm.io/package/fluent-ffmpeg.md) ^2.1.2
- [multi-progress](https://npm.io/package/multi-progress.md) ^4.0.0

## Recent versions

- 1.1.4 (latest) — 2023-05-24
- 1.1.3 — 2023-05-24
- 1.1.2 — 2023-05-23
- 1.1.1 — 2023-05-23
- 1.1.0 — 2023-05-19
- 1.0.2 — 2023-05-19
- 1.0.1 — 2023-05-19
- 1.0.0 — 2023-05-19

## README

# yt-playlist-downloader

A tool for downloading YouTube playlists.

## Installation

The Youtube Playlist Downloader package is available on npm as yt-playlist-downloader:

```shell
$ npm install --save yt-playlist-downloader
```

To use the module in your application, require it from any JavaScript file:

```javascript
const { PlaylistDownloader } = require("yt-playlist-downloader");
```

## Usage

```javascript
const { PlaylistDownloader } = require('yt-playlist-downloader');

const playlist_url = 'https://music.youtube.com/playlist?list=<PLAYLIST_ID>';
const max_parallel_downloads = 4; //Default: 5
const output_folder = './music' //Default: os.tmpdir()
const playlist_size_limit = Infinity; //Default: Infinity

const pldl = new PlaylistDownloader(
    playlist_url,
    max_parallel_downloads,
    output_folder,
    playlist_size_limit
);

pldl.download().then(() => {
    //Done!
}).catch((err) => {
    //Some error ocurred
});
```
## Events

### Information
Triggers when got playlist information

```javascript
pldl.on('info', (playlist_info) => {
    //Playlist info
});
```
### Status changed
Triggers when downloader status changes

```javascript
pldl.on('status_changed', (status) => {
    //status: 'preparing', 'downloading', 'completed'
})
```

### Progress
Triggers when there is progress in download

```javascript
pldl.on('progress' (progress) => {
    /*
        progress = {
            chunk_size: Max parallel downloads,
            accumulated: Bytes already downloaded,
            total_size: Total size in bytes,
            chunk: Chunk number,
            total_chunks: Total chunks,
            video_info: Video information,
        }
    */
});
```
### All completed
Triggers when all playlist vdeos are downloaded

```javascript
pldl.on('all_completed', (playlist_id) => {
    //Playlist download completed
})
```
### Single completed
Triggers when a single video is downloaded from playlist

```javascript
pldl.on('single_completed', (video_info) => {
    //Single video download complete
})

```

## License

This project is licensed under the MIT License.

## Repository

The source code for this module can be found on [GitHub](https://github.com/tomasbarak/youtube-playlist-downloader.git).

---
_Source: https://npm.io/package/yt-playlist-downloader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
