2.0.2 • Published 6 days ago

yt-converter v2.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
6 days ago

Node YoutubeDL - Easy to use downloader for YouTube videos

!IMPORTANT Version 2.0 Released. New way to use it.

Installation

npm install yt-converter

Usage

There's two ways to use this library, convert audio or video. For this the package exports two functions named Audio, and Video, each one is for convert audio and video respectively.

Converting Youtube Video to MP3 file

import { Video, Audio } from '../dist/src/index';

const link = 'https://www.youtube.com/watch?v=QI5idh3Uwh4&list=RDQI5idh3Uwh4&start_radio=1';

async function test(url:string) {
  const data = await Audio({
    url,
    onDownloading: (d) => console.log(d),
  });

  console.log(data.message);
}

test(link);

Converting Youtube Video to MP4 file

import { Video, Audio } from '../dist/src/index';

const link = 'https://www.youtube.com/watch?v=QI5idh3Uwh4&list=RDQI5idh3Uwh4&start_radio=1';

async function test(url:string) {
  const data = await Video({
    url,
    onDownloading: (d) => console.log(d),
  });

  console.log(data.message);
}

test(link);

Function params

Both fuctions need an options object.

  • url: Expect to be a string representing the url link of the youtube video.
  • directory (optional): Path relative where you want the file converted.
  • itag: This represents a number of a specific format. For more information
  • onDownloading (optional) : Function will be executed while the file is downloading.

Once the functions Video and Audio are executed, returns a promise wich resolve a data object.

  • message
  • error
  • videoInfo
2.0.2

6 days ago

2.0.1

6 days ago

1.3.5

4 months ago

2.0.0

4 months ago

1.3.4

11 months ago

1.3.3

1 year ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.3.2

2 years ago

1.2.3

2 years ago

1.3.1

2 years ago

1.2.2

2 years ago

1.3.0

2 years ago

1.2.9

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago