# youtube-scrapper

> Download videos and get info on them aswell as searching and other features.

Latest version **1.4.0** (published 2022-04-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install youtube-scrapper
pnpm add youtube-scrapper
yarn add youtube-scrapper
bun add youtube-scrapper
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2022-04-20 |
| First published | 2021-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16.6.7 |
| Dependencies | 4 |
| Unpacked size | 138.9 KB |
| Known vulnerabilities | 0 (+25 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 10 |
| Author | ruben40000 |
| Maintainers | ruben40000 |
| Keywords | scrapper, youtube, audio, livestream, youtube-scrapper, discord bots, discord, resources, stream, search, yt-scrapper, yt-sc, music, bots, fast, api, downloader |

## Links

- npm: https://www.npmjs.com/package/youtube-scrapper
- Repository: https://github.com/Rubenennj/youtube-scrapper
- Issues: https://github.com/Rubenennj/youtube-scrapper/issues
- npm.io page: https://npm.io/package/youtube-scrapper

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^0.21.1
- [miniget](https://npm.io/package/miniget.md) ^4.2.2
- [m3u8stream](https://npm.io/package/m3u8stream.md) ^0.8.4
- [fast-xml-parser](https://npm.io/package/fast-xml-parser.md) ^3.19.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.4.0 (latest) — 2022-04-20
- 1.3.0 — 2021-10-31
- 1.2.1 — 2021-10-31
- 1.2.0 — 2021-10-23
- 1.1.8 — 2021-10-05
- 1.1.7 — 2021-09-19
- 1.1.6 — 2021-09-19
- 1.1.5 — 2021-09-17
- 1.1.4 — 2021-09-14
- 1.1.3 — 2021-09-14
- 1.1.2 — 2021-09-14
- 1.1.1-s — 2021-09-14
- 1.1.0 — 2021-09-11
- 1.0.7 — 2021-09-08
- 1.0.6 — 2021-09-08
- … 6 more at https://npm.io/package/youtube-scrapper/versions

## README

# youtube-scrapper
[![NPM Version](https://img.shields.io/npm/v/youtube-scrapper.svg?maxAge=3600)](https://www.npmjs.com/package/youtube-scrapper)
[![NPM Downloads](https://img.shields.io/npm/dt/youtube-scrapper.svg?maxAge=3600)](https://www.npmjs.com/package/youtube-scrapper)

## Table Of Contents
- [Installing](#installing)
- [Useful Links](#links)
- [Example Usage](#example)
- [Disclaimer](#disclaimer)

### Links
- [Documentation](https://rubenennj.github.io/youtube-scrapper)
- [GitHub Repository](https://github.com/Rubenennj/youtube-scrapper)

### Installing
Simply use `npm i youtube-scrapper`.

### Example
```js
const scrapper = require("youtube-scrapper")
const { createWriteStream } = require("fs")

async function main() {
    // Getting videos through query.
    const result = await scrapper.search("best hits 2010")

    console.log(result.videos.map(vid => vid.details.title)) // Array of videos mapped by name.

    // Downloading first result and piping to a file.
    // We have to get the full song info first.
    const video = await scrapper.getVideoInfo(result.videos[0].id)

    // Write to file.
    scrapper
        .downloadFromVideo(video)
        .pipe(createWriteStream("./song.ogg"))
}

main()
```

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