# play-dl

> YouTube, SoundCloud, Spotify, Deezer searching and streaming for discord-js bots

Latest version **1.9.7** (published 2023-09-24) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install play-dl
pnpm add play-dl
yarn add play-dl
bun add play-dl
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.9.7 |
| Published | 2023-09-24 |
| First published | 2021-08-21 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16.0.0 |
| Dependencies | 1 |
| Unpacked size | 869.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Killer069 |
| Maintainers | killer069, tr1ckydev |
| Keywords | node-youtube-dl, youtube-dl, yt-dl, ytdl, youtube, spotify-dl, spotify, soundcloud, deezer |

## Links

- npm: https://www.npmjs.com/package/play-dl
- Repository: https://github.com/play-dl/play-dl
- Homepage: https://github.com/play-dl/play-dl#readme
- Issues: https://github.com/play-dl/play-dl/issues
- npm.io page: https://npm.io/package/play-dl

## Dependencies (1)

- [play-audio](https://npm.io/package/play-audio.md) ^0.5.2

## Recent versions

- 1.9.7 (latest) — 2023-09-24
- 1.9.6 — 2022-10-30
- 1.9.5 — 2022-05-30
- 1.9.4 — 2022-04-08
- 1.9.3 — 2022-03-31
- 1.9.2 — 2022-03-16
- 1.9.1 — 2022-03-12
- 1.9.0 — 2022-03-10
- 1.8.9 — 2022-02-27
- 1.8.8 — 2022-02-11
- 1.8.7 — 2022-02-09
- 1.8.6 — 2022-02-03
- 1.8.5 — 2022-02-03
- 1.8.4 — 2022-02-01
- 1.8.3 — 2022-01-31
- … 114 more at https://npm.io/package/play-dl/versions

## README

# Play-dl

A **light-weight** YouTube, SoundCloud, Spotify and Deezer streaming and searching library.

-   Search by video, playlist/album, channel/artist
-   Stream audio from YouTube and SoundCloud

# Why play-dl ?

[ytdl-core](https://github.com/fent/node-ytdl-core) has some issues with miniget and also stream abort issues. On the other hand, [youtube-dl](https://github.com/ytdl-org/youtube-dl) is a perfect alternative but it takes time to launch. Hence, play-dl is created to avoid these issues along with providing comparatively faster performance than others.

[![Discord](https://img.shields.io/discord/888998674716315679?color=00aa00&label=%20Discord&logo=Discord)](https://discord.gg/8H3xWcv3D7)
[![NPM](https://img.shields.io/npm/v/play-dl.svg?color=00aa00&logo=npm)](https://www.npmjs.com/package/play-dl)

## Support

You can contact us for support on our [chat server](https://discord.gg/8H3xWcv3D7).

### Installation

**Node.js 16.0.0 or newer is required.**

```bash
npm install play-dl@latest
pnpm add play-dl@latest
yarn add play-dl@latest
```

### Importing

**TypeScript:**
```ts
import play from 'play-dl'; // Everything

import { video_basic_info, stream } from 'play-dl'; // Individual functions
```

**CommonJS modules:**
```js
const play = require('play-dl'); // Everything

// Individual functions by using destructuring
const { video_basic_info, stream } = require('play-dl');
```

**ES6 modules:**
```ts
import play from 'play-dl'; // Everything

import { video_basic_info, stream } from 'play-dl'; // Individual functions
```

## **Compatibility issues** - discord-player
    
Because discord-player doesn't work with raw opus packets you need to enable the compatibility mode in `play-dl`, if you want to use both frameworks together.

- To fix the playback of YouTube videos with `discord-player`, you can disable some of play-dl's optimisations and fixes by setting the `discordPlayerCompatibility` option for `stream` and `stream_from_info` to true

- The `discordPlayerCompatiblity` option might break the playback of long YouTube videos.

- Even with the `discordPlayerCompatibility` option set you will not be able to use the seek option for `stream` and `stream_from_info`.
    

### [Documentation](https://play-dl.github.io/modules.html)
### [Examples](./examples)
### [Instructions](./instructions)

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