Registry / testing / hybrid-ytdl

hybrid-ytdl

JSON →
library1.2.4jsnpmunverified

Hybrid YouTube downloader for Node.js that uses 5 different server APIs to fetch audio and video downloads. Current stable version is 1.2.4. It automatically switches to a backup API if one server fails, supports custom bitrate (128, 192, 320 kbps) and resolution (360p, 720p, 1080p), and allows manual API selection. Differentiates from other YouTube downloaders by relying on external REST APIs rather than scraping YouTube directly, offering multiple fallback endpoints. The package is not actively maintained but still functional.

npm install hybrid-ytdl
INSTALL
IMPORT
SIG · HYBRID-YTDL
H
hybrid-ytdl
testingjavascriptv1.2.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

getVideoInfo
import { getVideoInfo } from 'hybrid-ytdl'
const { getVideoInfo } = require('hybrid-ytdl')
CommonJS require is also supported, but ESM import is preferred for modern Node.js projects.
downloadAudio
import { downloadAudio } from 'hybrid-ytdl'
import downloadAudio from 'hybrid-ytdl'
downloadAudio is a named export, not a default export.
downloadVideo
import { downloadVideo } from 'hybrid-ytdl'
const downloadVideo = require('hybrid-ytdl').downloadVideo
This works but is less idiomatic in TypeScript or ESM environments.

Shows how to fetch video info, download audio with custom bitrate, and download video with custom resolution using a specific API.

import { getVideoInfo, downloadAudio, downloadVideo } from 'hybrid-ytdl'; async function main() { const url = 'https://youtube.com/watch?v=kglEsR7bqAY'; const info = await getVideoInfo(url); console.log('Title:', info.title); const audio = await downloadAudio(url, '320', 'api2'); console.log('Audio URL:', audio.downloadUrl); const video = await downloadVideo(url, '1080', 'api2'); console.log('Video URL:', video.downloadUrl); } main().catch(console.error);
Debug
Known issues
breakingAPI endpoints may change or become unavailable without notice. The package relies on third-party servers that are not controlled by the maintainer.
fix
If an API fails, set up automatic fallback logic or monitor the API status externally.
affects: >=1.0.0
deprecatedBitrate and resolution custom values only work with API 2 (Nauval Group) and API 1 (Cloudkuimages) as of v1.2.0.
fix
When using custom bitrate or resolution, ensure you manually select api1 or api2, or verify behavior with other APIs.
affects: >=1.2.0
gotchaThe 'source' field in download responses returns a display string that may include formatting (e.g., 'API 2: Nauval Group'). Do not rely on it for programmatic API identification.
fix
Use the 'api' parameter you passed in or parse the download URL pattern to determine the source.
affects: >=1.0.0
gotchaAudio download with api5 (SuraWeb) is not supported; only video works for api5.
fix
Avoid using api5 for downloadAudio; use downloadVideo instead if needed.
affects: >=1.0.0
breakingThe package has no TypeScript type definitions. All imports will be typed as 'any' in TypeScript projects.
fix
Create your own type declarations or use JSDoc annotations for type safety.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: Cannot destructure property 'getVideoInfo' of 'require(...)' as it is undefined.
The package is not installed or the import path is incorrect.
fix
Run 'npm install hybrid-ytdl' and ensure you're requiring the correct package name.
Error: fetch is not defined
This package uses the fetch API internally, which is only available in Node.js 18+ or requires a polyfill.
fix
Use Node.js 18 or later, or install a fetch polyfill like 'node-fetch' and import it globally.
TypeError: Failed to fetch
The external API server returned an error or is temporarily down.
fix
Retry with a different API by passing the 'api' parameter (e.g., 'api2') or wait and try again.
Cannot read properties of undefined (reading 'title')
The API returned an error response but the package doesn't handle it gracefully, resulting in undefined info.
fix
Check the status field of the returned object before accessing properties. Wrap calls in try/catch.
Upgrade
Version history
1.2.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
hybrid-ytdl — npm install hybrid-ytdl · libregistry