Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@lyrra-evanth/src-yt

zarv7z1.9kMIT1.2.0

YouTube Downloader.

youtube, scraper, downloader, audio, y2mate, ytmp3, ytmp4, ytdl-core, video

readme

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);
        }
    });