@lordxdd/yt-dl
Version:
YouTube-dl
28 lines (18 loc) • 599 B
Markdown
A simple node.js wrapper for [yt-dlp](https://github.com/yt-dlp/yt-dlp).
You can install this yt-dl via npm (`npm i @lordxdd/yt-dl`).
YT-dlp will be automatically downloaded.
## Usage
```javascript
const { ytadl, ytvdl, yts } = require('@lordxdd/yt-dl');
const fs = require('fs');
(async () => {
//Audio
const audioPath = await ytadl(videoId);
const audioBuffer = fs.readFileSync(audioPath);
//Video (default: 720p)
const videoPath = await ytvdl(videoId, quality);
const videoBuffer = fs.readFileSync(videoPath);
})();
```