Skip to content
 
 

Repository files navigation

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 has some issues with miniget and also stream abort issues. On the other hand, 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.

Build NPM License Discord

Support

You can contact me for support on my chat server.

Installation

Node.js 20.0.0 or newer is required.

npm install @iamtraction/play-dl@latest
pnpm add @iamtraction/play-dl@latest
yarn add @iamtraction/play-dl@latest

Importing

TypeScript:

import play from '@iamtraction/play-dl'; // Everything

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

CommonJS modules:

const play = require('@iamtraction/play-dl'); // Everything

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

ES6 modules:

import play from '@iamtraction/play-dl'; // Everything

import { video_basic_info, stream } from '@iamtraction/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.

Credits

This project is a maintained fork of play-dl, continued under its original GPL-3.0 license.

About

A light-weight YouTube, SoundCloud, Spotify and Deezer streaming and searching library. Mainly used for Discord.js Bots to play music..

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages