https://github.com/j3lte/ytdl-wrapper
A simple module that wraps yt-dlp in a Deno package
https://github.com/j3lte/ytdl-wrapper
bun deno nodejs yt-dlp ytdl
Last synced: 6 months ago
JSON representation
A simple module that wraps yt-dlp in a Deno package
- Host: GitHub
- URL: https://github.com/j3lte/ytdl-wrapper
- Owner: j3lte
- License: mit
- Created: 2024-09-06T18:58:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-06T21:57:50.000Z (almost 2 years ago)
- Last Synced: 2025-01-23T08:35:50.341Z (over 1 year ago)
- Topics: bun, deno, nodejs, yt-dlp, ytdl
- Language: TypeScript
- Homepage: https://jsr.io/@j3lte/ytdl-wrapper
- Size: 38.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @j3lte/ytdl-wrapper
[](https://jsr.io/@j3lte/ytdl-wrapper)
[](https://github.com/j3lte/ytdl-wrapper/releases/latest)
## Overview
This is a simple module that wraps **[yt-dlp](https://github.com/yt-dlp/yt-dlp)**
## Basic Usage
```typescript
import { YTDLWrapper } from "@j3lte/ytdl-wrapper";
const ytdl = new YTDLWrapper();
// Get media info
const mediaInfo = await ytdl.getMediaInfo("https://www.youtube.com/watch?v=...");
// Download media
ytDlp
.exec(["https://www.youtube.com/watch?v=....", "-o", "/output/%(title)s.%(ext)s"])
.on("progress", (progress) => {
console.log("[PROGRESS]", progress.percent);
})
.on("event", (eventType, eventData) => {
console.log("[EVENT]", eventType, eventData);
})
.on("close", (code) => {
console.log("Process closed with code: " + code);
})
.on("error", (err) => {
console.log("ERROR", err);
});
```
## License
[MIT License](./LICENSE)