A DisTube playable extractor plugin using yt-dlp
What is a playable extractor plugin?
- Support 900+ sites using yt-dlp
npm install @distube/yt-dlp@latest
import { DisTube } from "distube";
import { YtDlpPlugin } from "@distube/yt-dlp";
const distube = new DisTube(client, {
plugins: [new YtDlpPlugin({ update: true })],
});
Create a DisTube's ExtractorPlugin
instance.
-
YtDlpPluginOptions.update
(boolean
): Default istrue
. Update the yt-dlp binary when the plugin is initialized.
YtDlpPlugin should be the last plugin in the
plugins
array.
-
YTDLP_DISABLE_DOWNLOAD
: Set it to disable download yt-dlp binary. -
YTDLP_URL
: The URL of the yt-dlp binary to download. -
YTDLP_DIR
: The directory to download the yt-dlp binary. -
YTDLP_FILENAME
: The filename of the yt-dlp binary.
Your IP has been rate-limited by GitHub and the plugin cannot get the latest link to the yt-dlp binary.
You can change the download link by using the environment variable YTDLP_URL
, or disable download by setting YTDLP_DISABLE_DOWNLOAD
to true
.
export YTDLP_URL=https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp
npm install @distube/yt-dlp@latest
export YTDLP_DISABLE_DOWNLOAD=true
npm install @distube/yt-dlp@latest
The plugin cannot download the yt-dlp binary on startup. Same as the previous case.
You can disable download on startup by using new YtDlpPlugin({ update: false })
or using above solution.
import { DisTube } from "distube";
const distube = new DisTube(client, {
plugins: [new YtDlpPlugin({ update: false })],
});