JSPM

@yggdrasil_fenrir/ytdlp-wrapper

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q30537F
  • License MIT

Cross-platform TypeScript wrapper for yt-dlp

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-wrapper

Usage

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
    └── ffmpeg

Make sure to make the Linux and macOS binaries executable:

chmod +x bin/linux/yt-dlp bin/linux/ffmpeg bin/macos/yt-dlp bin/macos/ffmpeg

Features

  • 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