1.0.10 • Published 5 months ago
coders-ytdl v1.0.10
coders-ytdl
A simple and practical YouTube downloader that is easy to integrate. You can integrate it into your project that requires downloading YouTube videos and audio or just to get YouTube metadata via a link.
Features
transcript()
- get Transcription information from URL Youtube
search()
- search metadata video with text
thinMetadata()
- get small metadata without links
getMetadata()
- get full metadata without links
getFullMetadata()
- get full metadata with links
getBufferAudio()
- convert best audio to buffer
getBufferVideo()
- convert best video to buffer
Installation
Install coders-ytdl with:
NPM
npm install coders-ytdl
PNPM
pnpm install coders-ytdl
YARN
yarn install coders-ytdl
Usage/Examples
ESM
import CodersYtdl from 'coders-ytdl';
(async (url) => {
try {
const init = new CodersYtdl(); // can also new CodersYtdl(url);
// If there is no URL argument in the constructor, you can add the method below.
init.downloadLink(url);
const result = await Promise.all([
await init.getMetadata(),
await init.getFullMetadata(),
await init.transcript(),
await init.getBufferAudio(),
await init.getBufferVideo()
]);
console.log('Metadata:', result[0]);
console.log('Full Metadata:', result[1]);
console.log('Transcript:', result[2]);
console.log('Audio:', result[3]);
console.log('Video:', result[4]);
} catch (error) {
console.error(error);
}
})('https://www.youtube.com/watch?v=IWKyykQBRKo');
CommonJS
const CodersYtdl = require('coders-ytdl');
(async (url) => {
try {
const init = new CodersYtdl(); // can also new CodersYtdl(url);
// If there is no URL argument in the constructor, you can add the method below.
init.downloadLink(url);
const result = await Promise.all([
await init.getMetadata(),
await init.getFullMetadata(),
await init.transcript(),
await init.getBufferAudio(),
await init.getBufferVideo()
]);
console.log('Metadata:', result[0]);
console.log('Full Metadata:', result[1]);
console.log('Transcript:', result[2]);
console.log('Audio:', result[3]);
console.log('Video:', result[4]);
} catch (error) {
console.error(error);
}
})('https://www.youtube.com/watch?v=IWKyykQBRKo');
Authors
Feedback
If you have any feedback, please reach out to us at farhanxcode7@gmail.com