Package Exports
- @yggdrasil_fenrir/ytdlp-wrapper
- @yggdrasil_fenrir/ytdlp-wrapper/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@yggdrasil_fenrir/ytdlp-wrapper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ytdlp-wrapper
A TypeScript wrapper for yt-dlp with cross-platform binary support.
Installation
npm i @yggdrasil_fenrir/ytdlp-wrapperUsage
import { YtDlp } from '@yggdrasil_fenrir/ytdlp-wrapper';
const ytdlp = new YtDlp();
// Download a video
await ytdlp.download('https://youtube.com/watch?v=...', {
format: 'best',
output: '%(title)s.%(ext)s'
});
// Get video information
const info = await ytdlp.getInfo('https://youtube.com/watch?v=...');
console.log(info.title);
// Extract audio
await ytdlp.download('https://youtube.com/watch?v=...', {
extractAudio: true,
audioFormat: 'mp3',
audioQuality: '0' // best
});Binary Structure
Place the binaries in the following structure:
bin/
├── windows/
│ ├── yt-dlp.exe
│ └── ffmpeg.exe
├── linux/
│ ├── yt-dlp
│ └── ffmpeg
└── macos/
├── yt-dlp
└── ffmpegMake sure to make the Linux and macOS binaries executable:
chmod +x bin/linux/yt-dlp bin/linux/ffmpeg bin/macos/yt-dlp bin/macos/ffmpegFeatures
- Cross-platform support (Windows, macOS, Linux)
- TypeScript types included
- Video download with customizable options
- Audio extraction
- Subtitle download
- Playlist support
- Video information retrieval
- Custom command-line arguments support
License
MIT