# ytdl

> A command line streaming youtube video downloader.

Latest version **1.4.1** (published 2020-12-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install ytdl
pnpm add ytdl
yarn add ytdl
bun add ytdl
```

Provides the command `ytdl`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.4.1 |
| Published | 2020-12-01 |
| First published | 2012-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 9 |
| Unpacked size | 16.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1290 |
| Author | fent |
| Maintainers | fent |
| Keywords | youtube, download, video, cli |

## Links

- npm: https://www.npmjs.com/package/ytdl
- Repository: https://github.com/fent/node-ytdl
- Homepage: https://github.com/fent/node-ytdl#readme
- Issues: https://github.com/fent/node-ytdl/issues
- npm.io page: https://npm.io/package/ytdl

## Dependencies (9)

- [chalk](https://npm.io/package/chalk.md) ^4.0.0
- [homedir](https://npm.io/package/homedir.md) ^0.6.0
- [list-it](https://npm.io/package/list-it.md) ^1.3.3
- [commander](https://npm.io/package/commander.md) ^6.1.0
- [ytdl-core](https://npm.io/package/ytdl-core.md) ^4.1.0
- [streamspeed](https://npm.io/package/streamspeed.md) ^2.0.1
- [cli-progress](https://npm.io/package/cli-progress.md) ^3.8.2
- [lodash.throttle](https://npm.io/package/lodash.throttle.md) ^4.1.1
- [sanitize-filename](https://npm.io/package/sanitize-filename.md) ^1.6.3

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.4.1 (latest) — 2020-12-01
- 1.4.0 — 2020-11-30
- 1.3.5 — 2020-07-28
- 1.3.4 — 2020-07-25
- 1.3.3 — 2020-07-14
- 1.3.2 — 2020-06-03
- 1.3.1 — 2020-06-01
- 1.3.0 — 2020-04-11
- 1.2.0 — 2020-02-10
- 1.1.0 — 2019-12-08
- 1.0.1 — 2019-11-27
- 1.0.0 — 2019-11-27
- 0.13.1 — 2019-09-11
- 0.13.0 — 2019-09-06
- 0.12.0 — 2019-07-09
- … 71 more at https://npm.io/package/ytdl/versions

## README

# node-ytdl

A youtube downloader written in Javascript. To be used with the command line. If you're looking to use it in your node program, check out [ytdl-core](https://github.com/fent/node-ytdl-core).

![Depfu](https://img.shields.io/depfu/fent/node-ytdl)
[![codecov](https://codecov.io/gh/fent/node-ytdl/branch/master/graph/badge.svg)](https://codecov.io/gh/fent/node-ytdl)

# Usage

Streams to stdout by default

    ytdl "http://www.youtube.com/watch?v=_HSylqgVYQI" | mpv -

To save to a file

    ytdl "http://www.youtube.com/watch?v=_HSylqgVYQI" > myvideo.mp4

or

    ytdl -o "{author.name} - {title}" "http://www.youtube.com/watch?v=_HSylqgVYQI"


Download video and convert to mp3 (Requires ffmpeg)

```bash
ytdl http://www.youtube.com/watch?v=_HSylqgVYQI | ffmpeg -i pipe:0 -b:a 192K -vn myfile.mp3
```


Supported options

    Usage: ytdl <url> [options]

    url     URL to the video.

    Options:
       -v, --version                  Print program version.
       -q ITAG, --quality ITAG        Video quality to download, default: highest
       -r INT-INT, --range INT-INT    Byte range to download, ie 10355705-12452856
       -b INT, --begin INT            Time to begin video, format by 1:30.123 and 1m30s
       -o FILE, --output FILE         Save to file, template by {prop}, default: stdout
       --filter STR                   Can be video, videoonly, audio, audioonly
       --filter-container REGEXP      Filter in format container
       --unfilter-container REGEXP    Filter out format container
       --filter-resolution REGEXP     Filter in format resolution
       --unfilter-resolution REGEXP   Filter out format resolution
       --filter-encoding REGEXP       Filter in format encoding
       --unfilter-encoding REGEXP     Filter out format encoding
       -i, --info                     Print video info without downloading
       -j, --info-json                Print video info as JSON without downloading
       --print-url                    Print direct download URL
       --no-cache                     Skip file cache for html5player
       --debug                        Print debug information


# Install

    npm -g install ytdl


# Tests
Tests are written with [mocha](https://mochajs.org)

```bash
npm test
```

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