YOUTUBE CONVERTER L7Z
It will be updated every time there is an error, so use the latest tag for the latest automatic updates.
Installation
You can install the package using npm:
npm install @lyrra-evanth/src-yt
Usage
const { search, ytmp3, ytmp4, ytdlv2 } = require('@lyrra-evanth/src-yt');
Quality Available
const audio = [ 64, 96, 128, 192, 256, 320, 1000, 1411 ]
const video = [ 360, 480, 720, 1080, 1440 ]
Download Audio (MP3)
// url YouTube
const url = 'https://www.youtube.com/watch?v=url_link';
// quality download, select in Quality Available
const quality = "128"
/*
* or you can just use the url
* for default quality (128)
* example: ytmp3(url)
*/
ytmp3(url, quality)
.then(result => {
if (result.status) {
console.log('Download Link:', result.download);
console.log('Metadata:', result.metadata);
} else {
console.error('Error:', result.result);
}
});
Download Video (MP4)
// url YouTube
const url = 'https://www.youtube.com/watch?v=url_link';
// quality download, select in Quality Available
const quality = "360"
/*
* or you can just use the url
* for default quality (360)
* example: ytmp4(url)
*/
ytmp4(url, quality)
.then(result => {
if (result.status) {
console.log('Download Link:', result.download);
console.log('Metadata:', result.metadata);
} else {
console.error('Error:', result.result);
}
});
Download YTDLV2 (MP3 & MP4)
// url YouTube
const url = 'https://www.youtube.com/watch?v=url_link';
/*
* quality download
* select in Quality Available
* can be in audio format
* or video
*/
const quality = 360
const quality = 128
/*
* or you can just use the url
* for default quality (128 & 360)
* example: ytdlv2(url)
*/
ytdlv2(url, quality)
.then(result => {
if (result.status) {
console.log('Download Link:', result.download);
console.log('Metadata:', result.metadata);
} else {
console.error('Error:', result.result);
}
});
Search Video
const query = 'your search term';
search(query)
.then(result => {
if (result.status) {
console.log('Search Results:', result.results);
} else {
console.error('Error:', result.result);
}
});