@distube/yt-dlp
v2.0.1
Published
A DisTube playable extractor plugin using yt-dlp.
Downloads
4,247
Readme
@distube/yt-dlp
A DisTube playable extractor plugin using yt-dlp
What is a playable extractor plugin?
Feature
- Support 900+ sites using yt-dlp
Requirement
Installation
npm install @distube/yt-dlp@latest
Usage
import { DisTube } from "distube";
import { YtDlpPlugin } from "@distube/yt-dlp";
const distube = new DisTube(client, {
plugins: [new YtDlpPlugin({ update: true })],
});
Documentation
new YtDlpPlugin([YtDlpPluginOptions])
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.
Environment Variables
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.
Troubleshooting
Failed to install (Status code: 403)
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
Failed to run the plugin (Status code: 403)
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 })],
});