ytdl-fetch
v1.0.1
Published
A modern Node.js library to fetch and download YouTube video/audio streams with high performance and minimal dependencies.
Maintainers
Readme
🎬 ytdl-fetch
A simple and powerful library to download YouTube videos and audio using an external API.
✨ Features
- 📥 Download videos in MP4
- 🎵 Download audio in MP3
- 📊 Get video information
- ⚡ Simple and clean API
- 🧩 Easy integration with any Node.js project
📦 Installation
npm install ytdl-fetchor
yarn add ytdl-fetch🚀 Usage
import { YTDLApi } from "ytdl-fetch"
const ytdlApi = new YTDLApi()
// Download video as mp4
ytdlApi.download.mp4({
videoId: "b8Qb0qwSaM0",
quality: "1080" // Optional, default is 1080p, Options: "1080" | "720" | "480" | "360" | "240" | "144"
}).then((result) => {
console.log(result)
}).catch((err) => {
console.error(err)
})
// Download video as mp3
ytdlApi.download.mp3({
videoId: "b8Qb0qwSaM0",
quality: "320" // Optional, default is 320kbps, Options: "320" | "256" | "128" | "96" | "64"
}).then((result) => {
console.log(result)
}).catch((err) => {
console.error(err)
})
// Get video info
ytdlApi.video.info({
videoId: "b8Qb0qwSaM0",
}).then((result) => {
console.log(result)
}).catch((err) => {
console.error(err)
})