Files
play-dl-test/README.md

67 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

2021-11-26 13:22:36 +05:30
# Play-dl
2021-12-15 17:09:57 +01:00
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
2021-11-26 13:22:36 +05:30
# Why play-dl ?
2021-08-22 18:49:25 +05:30
2021-12-15 17:09:57 +01:00
[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.
2021-08-22 18:49:25 +05:30
2021-12-15 17:09:57 +01:00
[![Discord](https://img.shields.io/discord/888998674716315679?color=00aa00&label=%20Discord&logo=Discord)](https://discord.gg/8H3xWcv3D7)
2021-12-18 14:07:24 +01:00
[![NPM](https://img.shields.io/npm/v/play-dl.svg?color=00aa00&logo=npm)](https://www.npmjs.com/package/play-dl)
2021-09-21 13:49:27 +05:30
2021-09-21 13:30:42 +05:30
## Support
2021-12-15 17:09:57 +01:00
You can contact us for support on our [chat server](https://discord.gg/8H3xWcv3D7).
2021-09-21 13:30:42 +05:30
2021-08-22 18:49:25 +05:30
### Installation
2021-12-15 17:09:57 +01:00
**Node.js 16.0.0 or newer is required.**
```bash
2021-08-22 18:49:25 +05:30
npm install play-dl@latest
2021-12-15 17:09:57 +01:00
pnpm add play-dl@latest
yarn add play-dl@latest
2021-08-22 18:49:25 +05:30
```
### Importing
2021-09-21 13:00:38 +05:30
2021-12-15 17:09:57 +01:00
**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
2021-12-17 15:37:30 +05:30
import play from 'play-dl'; // Everything
2021-12-15 17:09:57 +01:00
import { video_basic_info, stream } from 'play-dl'; // Individual functions
```
2021-11-21 14:58:46 +05:30
2022-01-20 16:52:48 +05:30
## **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
2022-01-20 16:54:04 +05:30
- The `discordPlayerCompatiblity` option might break the playback of long YouTube videos.
2022-01-20 16:52:48 +05:30
- Even with the `discordPlayerCompatibility` option set you will not be able to use the seek option for `stream` and `stream_from_info`.
2021-11-23 11:08:36 +05:30
### [Documentation](https://play-dl.github.io/modules.html)
### [Examples](./examples)
2021-11-23 11:21:43 +05:30
### [Instructions](./instructions)